/**
 * BYI Player Data Modal - Styles
 * Standalone CSS for modal functionality
 */

/* Modal Container */
.byi-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 99999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

/* Overlay */
.byi-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(2px);
    animation: byiFadeIn 0.2s ease-out;
}

/* Modal Content */
.byi-modal-content {
    position: relative;
    max-width: 1200px;
    width: 90%;
    max-height: 90vh;
    margin: 2% auto;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: byiSlideIn 0.3s ease-out;
    display: flex;
    flex-direction: column;
}

/* Modal Header */
.byi-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 1.75rem;
    border-bottom: 1px solid #e5e7eb;
    background: linear-gradient(to bottom, #f9fafb, #ffffff);
    flex-shrink: 0;
}

.byi-modal-header h3 {
    margin: 0;
    font-size: 1.375rem;
    font-weight: 600;
    color: #111827;
    letter-spacing: -0.01em;
}

/* Close Button */
.byi-modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #6b7280;
    transition: all 0.2s ease;
    border-radius: 6px;
}

.byi-modal-close:hover {
    background: #fee2e2;
    color: #dc2626;
    transform: scale(1.1);
}

.byi-modal-close:active {
    transform: scale(0.95);
}

/* Modal Body */
.byi-modal-body {
    padding: 0;
    flex: 1;
    overflow: hidden;
    position: relative;
    background: #f9fafb;
}

/* Loader */
.byi-modal-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 600px;
    gap: 1rem;
}

.byi-modal-loader p {
    margin: 0;
    color: #6b7280;
    font-size: 0.875rem;
    font-weight: 500;
}

/* Spinner */
.byi-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: byiSpin 0.8s linear infinite;
}

/* Iframe */
#byi-player-data-iframe {
    border: none;
    width: 100%;
    height: 600px;
    background: white;
}

/* Animations */
@keyframes byiFadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes byiSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes byiSpin {
    to {
        transform: rotate(360deg);
    }
}

/* Tablet Styles */
@media (max-width: 1024px) {
    .byi-modal-content {
        width: 95%;
        max-height: 95vh;
    }

    .byi-modal-header h3 {
        font-size: 1.25rem;
    }
}

/* Mobile Styles */
@media (max-width: 768px) {
    .byi-modal-content {
        width: 100%;
        height: 100%;
        max-height: 100vh;
        margin: 0;
        border-radius: 0;
    }

    .byi-modal-header {
        padding: 1rem 1.25rem;
    }

    .byi-modal-header h3 {
        font-size: 1.125rem;
    }

    .byi-modal-close {
        width: 32px;
        height: 32px;
        font-size: 1.75rem;
    }

    #byi-player-data-iframe {
        height: calc(100vh - 60px);
    }

    .byi-modal-loader {
        height: calc(100vh - 60px);
    }
}

/* Small Mobile */
@media (max-width: 480px) {
    .byi-modal-header h3 {
        font-size: 1rem;
    }

    .byi-spinner {
        width: 40px;
        height: 40px;
        border-width: 3px;
    }
}

/* Prevent body scroll when modal is open */
body.byi-modal-open {
    overflow: hidden !important;
}

/* Focus styles for accessibility */
.byi-modal-close:focus {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Print styles - hide modal when printing */
@media print {
    .byi-modal {
        display: none !important;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    .byi-modal-content {
        background: #1f2937;
    }

    .byi-modal-header {
        background: linear-gradient(to bottom, #111827, #1f2937);
        border-bottom-color: #374151;
    }

    .byi-modal-header h3 {
        color: #f9fafb;
    }

    .byi-modal-close {
        color: #9ca3af;
    }

    .byi-modal-close:hover {
        background: #7f1d1d;
        color: #fca5a5;
    }

    .byi-modal-body {
        background: #111827;
    }

    .byi-modal-loader p {
        color: #9ca3af;
    }

    .byi-spinner {
        border-color: #374151;
        border-top-color: #60a5fa;
    }
}