/**
 * Bookmaker Comparison Modal Styles
 *
 * Professional modal for comparing odds from all bookmakers
 * Features: Table layout, best odds highlighting, smooth animations
 *
 * @package PogzTennis
 * @since 2.0.0
 */

/* ====================================
   Modal Overlay & Container
   ==================================== */

.bookmaker-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.bookmaker-modal.is-active {
    visibility: visible;
    opacity: 1;
}

.modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(4px);
}

.modal__container {
    position: relative;
    max-width: 900px;
    width: 90%;
    max-height: 90vh;
    background: linear-gradient(135deg, #1a1a1a 0%, #0f0f0f 100%);
    border: 1px solid rgba(191, 254, 45, 0.3);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ====================================
   Modal Header
   ==================================== */

.modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 24px 28px;
    background: linear-gradient(135deg, rgba(191, 254, 45, 0.1) 0%, rgba(191, 254, 45, 0.05) 100%);
    border-bottom: 1px solid rgba(191, 254, 45, 0.2);
}

.modal__title {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 20px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.modal__title svg {
    fill: #BFFE2D;
}

.modal__close {
    width: 36px;
    height: 36px;
    padding: 0;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal__close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg);
}

.modal__close svg {
    fill: #fff;
}

/* ====================================
   Modal Content
   ==================================== */

.modal__content {
    padding: 24px 28px;
    max-height: calc(90vh - 100px);
    overflow-y: auto;
}

/* Custom scrollbar */
.modal__content::-webkit-scrollbar {
    width: 8px;
}

.modal__content::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.modal__content::-webkit-scrollbar-thumb {
    background: rgba(191, 254, 45, 0.3);
    border-radius: 4px;
}

.modal__content::-webkit-scrollbar-thumb:hover {
    background: rgba(191, 254, 45, 0.5);
}

/* ====================================
   Player Header
   ==================================== */

.comparison__players {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
}

.comparison__player {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 18px;
    font-weight: 600;
}

.comparison__player--home {
    justify-content: flex-start;
}

.comparison__player--away {
    justify-content: flex-end;
    flex-direction: row-reverse;
}

.comparison__flag {
    font-size: 28px;
}

.comparison__name {
    color: #fff;
}

.comparison__vs {
    font-size: 14px;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.5);
    letter-spacing: 2px;
}

/* ====================================
   Comparison Table
   ==================================== */

.comparison__table-wrapper {
    overflow-x: auto;
    margin-bottom: 24px;
}

.comparison__table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.comparison__table thead th {
    background: rgba(191, 254, 45, 0.1);
    color: #BFFE2D;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 2px solid rgba(191, 254, 45, 0.3);
    position: sticky;
    top: 0;
    z-index: 10;
}

.comparison__table thead th:first-child {
    border-top-left-radius: 8px;
}

.comparison__table thead th:last-child {
    border-top-right-radius: 8px;
    text-align: center;
}

.comparison__table tbody tr {
    transition: background 0.2s ease;
}

.comparison__table tbody tr:hover {
    background: rgba(191, 254, 45, 0.05);
}

.comparison__table tbody tr.row--best {
    background: linear-gradient(90deg, rgba(191, 254, 45, 0.1) 0%, rgba(191, 254, 45, 0.05) 100%);
}

.comparison__table tbody td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.8);
}

.bookmaker-cell {
    font-weight: 600;
    color: #fff;
}

.bookmaker-name {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.odds-cell {
    font-size: 16px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-align: center;
    position: relative;
}

.odds-cell--best {
    color: #BFFE2D;
    font-size: 18px;
}

.best-badge {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    background: #BFFE2D;
    color: #000;
    font-size: 9px;
    font-weight: 700;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.odds-na {
    color: rgba(255, 255, 255, 0.3);
    font-style: italic;
}

.best-for-cell {
    text-align: center;
}

.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.badge--home {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.badge--away {
    background: rgba(33, 150, 243, 0.2);
    color: #2196F3;
    border: 1px solid rgba(33, 150, 243, 0.3);
}

.badge--neutral {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ====================================
   Statistics Section
   ==================================== */

.comparison__stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
}

.stat-item {
    text-align: center;
}

.stat-label {
    display: block;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    margin-bottom: 4px;
}

.stat-value {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #BFFE2D;
    font-variant-numeric: tabular-nums;
}

/* ====================================
   Disclaimer
   ==================================== */

.comparison__disclaimer {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px;
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 8px;
}

.comparison__disclaimer svg {
    flex-shrink: 0;
    fill: #FFC107;
    margin-top: 2px;
}

.comparison__disclaimer p {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
    margin: 0;
    line-height: 1.6;
}

.comparison__disclaimer small {
    font-size: 11px;
    color: rgba(255, 255, 255, 0.5);
}

/* ====================================
   Responsive Design
   ==================================== */

@media (max-width: 768px) {
    .modal__container {
        width: 95%;
        max-height: 95vh;
    }

    .modal__header {
        padding: 20px;
    }

    .modal__content {
        padding: 20px;
    }

    .modal__title {
        font-size: 18px;
    }

    .comparison__players {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }

    .comparison__player {
        flex-direction: row !important;
        justify-content: center !important;
    }

    .comparison__stats {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .comparison__table {
        font-size: 14px;
    }

    .comparison__table thead th,
    .comparison__table tbody td {
        padding: 10px 8px;
    }

    .bookmaker-name {
        font-size: 13px;
    }

    .odds-cell {
        font-size: 14px;
    }

    .odds-cell--best {
        font-size: 16px;
    }
}

/* ====================================
   Accessibility
   ==================================== */

.modal__close:focus-visible {
    outline: 2px solid #BFFE2D;
    outline-offset: 2px;
}

/* ====================================
   Dark Mode (already dark, but ensure compatibility)
   ==================================== */

body.dark-mode .modal__container {
    background: linear-gradient(135deg, #0a0a0a 0%, #000 100%);
}

/* ====================================
   Animations
   ==================================== */

@media (prefers-reduced-motion: reduce) {
    .modal__container,
    .modal__close {
        animation: none;
        transition: none;
    }
}
