/* ============================================
   TABLE STYLES - ChatGPT Branding
   Modern Desktop Table + Mobile Cards
   ============================================ */

.predictions-table {
    padding: 0;
    display: none; /* Hidden by default, shown after typing */
    width: 100%;
    margin-top: 20px;
}

.table-container {
    width: 100%;
    overflow: hidden;
    padding-top: 20px;
}

/* ============================================
   DESKTOP TABLE - Clean & Professional
   ============================================ */
.desktop-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--bg-secondary);
    border-radius: 0;
    overflow: hidden;
    display: none;
}

@media (min-width: 1024px) {
    .desktop-table {
        display: table;
    }

    .predictions-table {
        max-width: 100%;
        width: 100%;
        padding: 20px 40px;
        margin-top: 20px;
    }

    .table-container {
        border-radius: 12px 12px 0 0;
        overflow: hidden;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
        max-width: 100%;
    }
}

@media (min-width: 1600px) {
    .predictions-table {
        padding: 20px 60px;
        margin-top: 20px;
    }
}

.desktop-table thead {
    background: var(--bg-tertiary);
}

.desktop-table th {
    padding: 18px 20px;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 2px solid var(--border-color);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.desktop-table tbody tr {
    border-bottom: 1px solid var(--border-color);
}

.desktop-table tbody tr:last-child {
    border-bottom: none;
}

.desktop-table td {
    padding: 20px;
    color: var(--text-primary);
    font-size: 14px;
    vertical-align: top;
}

/* Match Column */
.match-cell {
    min-width: 200px;
}

.team-home,
.team-away {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 4px;
    font-size: 14px;
}

.vs {
    color: var(--text-muted);
    font-size: 12px;
    margin: 4px 0;
}

.match-time {
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 8px;
}

/* League Column */
.league-cell {
    min-width: 140px;
    white-space: nowrap;
}

.league-icon {
    margin-right: 6px;
}

/* Prediction/Outcome Column */
.outcome-cell {
    min-width: 160px;
}

.outcome-icon {
    font-size: 18px;
    margin-right: 8px;
    vertical-align: middle;
}

/* Confidence Column */
.confidence-cell {
    min-width: 200px;
}

.confidence-container {
    width: 100%;
}

.confidence-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    font-size: 12px;
    color: var(--text-muted);
}

.confidence-percentage {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-secondary);
}

.confidence-bar {
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 4px;
    transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Details Column */
.details-cell {
    min-width: 280px;
}

.details-grid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: var(--bg-tertiary);
    border-radius: 6px;
}

.detail-label {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.detail-value {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-primary);
}

/* Table Row Animation */
.table-row {
    animation: slideInRow 0.4s ease-out forwards;
    opacity: 0;
}

@keyframes slideInRow {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ============================================
   MOBILE CARD VIEW - No Horizontal Scroll
   ============================================ */
.mobile-cards {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    padding-left: 0;
    padding-right: 0;
    box-sizing: border-box;
}

@media (min-width: 768px) {
    .mobile-cards {
        padding-left: 40px;
        padding-right: 40px;
    }
}

@media (min-width: 1024px) {
    .mobile-cards {
        padding-left: 60px;
        padding-right: 60px;
        margin-top: 20px;
    }
}

@media (min-width: 1024px) {
    .mobile-cards {
        display: flex;
        flex-direction: column;
        gap: 16px;
    }
}

.match-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    width: 100%;
    box-sizing: border-box;
    position: relative;
}

/* Card Header */
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
    gap: 12px;
    flex-wrap: wrap;
}

.match-teams {
    flex: 1;
    min-width: 0;
}

.card-header .team-home,
.card-header .team-away {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
    font-size: 15px;
}

.match-vs {
    color: var(--text-muted);
    font-size: 12px;
    text-align: center;
    margin: 6px 0;
    font-weight: 400;
}

.card-header .match-time {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    font-size: 12px;
    margin-top: 8px;
}

/* League Badge */
.league-info {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-tertiary);
    padding: 8px 12px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.league-name {
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

/* Prediction Grid - Stacked on Mobile */
.card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

@media (min-width: 640px) {
    .card-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.prediction-card {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 14px;
}

.prediction-title {
    font-size: 11px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
    font-weight: 600;
}

.prediction-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--accent-primary);
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

/* Top Pick Badge */
.top-pick-badge {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: white;
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    align-self: center;
}

/* ============================================
   TABLE FOOTER
   ============================================ */
.table-footer {
    padding: 20px 40px;
    text-align: center;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: 0 0 12px 12px;
}

@media (min-width: 1600px) {
    .table-footer {
        padding: 20px 60px;
    }
}

@media (max-width: 1023px) {
    .table-footer {
        padding: 20px;
    }
}

.matches-count {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 8px;
    font-weight: 500;
}

.disclaimer {
    color: var(--text-muted);
    font-size: 12px;
}

/* ============================================
   ANIMATIONS
   ============================================ */
.match-card {
    animation: slideIn 0.3s ease-out forwards;
    opacity: 0;
    transform: translateY(10px);
}

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Stagger animation for multiple cards */
.match-card:nth-child(1) { animation-delay: 0.05s; }
.match-card:nth-child(2) { animation-delay: 0.1s; }
.match-card:nth-child(3) { animation-delay: 0.15s; }
.match-card:nth-child(4) { animation-delay: 0.2s; }
.match-card:nth-child(5) { animation-delay: 0.25s; }

/* ============================================
   RESPONSIVE DESIGN - Mobile First
   ============================================ */

/* Extra Small Devices (< 480px) */
@media (max-width: 479px) {
    .match-card {
        padding: 16px;
        margin-bottom: 10px;
    }

    .card-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .league-info {
        width: 100%;
        justify-content: center;
    }

    .card-header .team-home,
    .card-header .team-away {
        font-size: 14px;
    }

    .card-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .prediction-card {
        padding: 12px;
    }
}

/* Small Tablets (480px - 639px) */
@media (min-width: 480px) and (max-width: 639px) {
    .match-card {
        padding: 18px;
    }

    .card-grid {
        grid-template-columns: 1fr;
    }
}

/* Tablets (640px - 1023px) */
@media (min-width: 640px) and (max-width: 1023px) {
    .match-card {
        padding: 20px;
    }

    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    .match-card,
    .table-row,
    .confidence-fill,
    .detail-item,
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* Focus states for keyboard navigation */
.match-card:focus-within {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

.detail-item:focus-within,
.prediction-card:focus-within {
    outline: 1px solid var(--accent-primary);
    outline-offset: 1px;
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .match-card {
        break-inside: avoid;
        border: 1px solid #333;
        box-shadow: none;
        page-break-inside: avoid;
    }

    .desktop-table {
        display: table;
        break-inside: avoid;
    }

    .mobile-cards {
        display: none;
    }

    .search-container,
    .install-btn,
    .table-footer {
        display: none;
    }
}

/* ============================================
   MATCH CARD — Reference design
   ============================================ */
.match-card {
    padding: 0 !important;
    border-radius: 14px;
    overflow: hidden;
    background: #1a1a1f;
    border: 1px solid rgba(255,255,255,0.08) !important;
}

/* Flag image */
.flag-img {
    width: 22px;
    height: 15px;
    border-radius: 2px;
    object-fit: cover;
    flex-shrink: 0;
}

/* ── Card header: country+league left, date+time right ── */
.mc-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 10px 14px 7px;
    gap: 8px;
}
.mc-meta-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}
.mc-country-row {
    display: flex;
    align-items: center;
    gap: 6px;
}
.mc-country-name {
    font-size: 12px;
    font-weight: 600;
    color: #ececec;
}
.mc-league {
    font-size: 11px;
    color: rgba(236,236,241,0.45);
    font-weight: 400;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mc-meta-right {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
    flex-shrink: 0;
}
.mc-date {
    font-size: 12px;
    font-weight: 700;
    color: #ececec;
}
.mc-time-val {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: rgba(236,236,241,0.5);
}

/* ── Teams row ── */
.mc-teams {
    display: flex;
    align-items: center;
    padding: 8px 14px 10px;
    gap: 8px;
}
.mc-team {
    flex: 1;
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    text-align: right;
}
.mc-team-right { text-align: left; }
.mc-vs {
    font-size: 10px;
    color: rgba(236,236,241,0.3);
    font-weight: 600;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

/* ── Stats bar — darker pill at bottom ── */
.mc-stats-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: rgba(255,255,255,0.05);
    border-top: 1px solid rgba(255,255,255,0.07);
    border-radius: 0 0 14px 14px;
    flex-wrap: wrap;
}
.mc-stat-item {
    font-size: 12px;
    font-weight: 700;
    color: #4da6ff;
    display: flex;
    align-items: center;
    gap: 4px;
}
.mc-stat-sep { color: rgba(236,236,241,0.15); font-size: 13px; line-height: 1; }
.mc-conf  { color: #10a37f !important; }
.mc-odd   { color: rgba(236,236,241,0.8) !important; }
.mc-score { color: rgba(236,236,241,0.6) !important; font-weight: 500; }

/* ── Desktop table: league row in match cell ── */
.match-league-row {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 5px;
}
.match-league-name {
    font-size: 11px;
    color: rgba(236,236,241,0.4);
}

/* ── VIP shared ── */
.vip-row td { padding: 0 !important; }
.vip-card { overflow: hidden; }
.vip-row td, .vip-card { position: relative; overflow: hidden; }
.vip-blur { filter: blur(5px); opacity: 0.35; user-select: none; pointer-events: none; }
.vip-teams-wrap { position: relative; }
.vip-pill {
    position: absolute; top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(8,24,60,0.94);
    color: #4da6ff;
    border: 1px solid rgba(77,166,255,0.4);
    border-radius: 24px;
    padding: 7px 16px;
    font-size: 13px; font-weight: 700;
    display: flex; align-items: center; gap: 6px;
    white-space: nowrap;
    backdrop-filter: blur(6px);
    z-index: 5;
    box-shadow: 0 2px 12px rgba(0,0,0,0.4);
}
.vip-card-cta {
    padding: 12px 16px;
    display: flex;
    justify-content: center;
    border-top: 1px solid rgba(255,255,255,0.06);
}
.vip-card-cta .vip-unlock-btn { margin-top: 0; padding: 9px 22px; font-size: 13px; }
.vip-unlock-btn {
    display: inline-block; padding: 6px 14px;
    background: #10a37f; color: #fff !important;
    font-size: 12px; font-weight: 700;
    border-radius: 8px; text-decoration: none !important;
    transition: background 0.2s; white-space: nowrap;
}
.vip-unlock-btn:hover { background: #0d8c6c; }

/* ── Desktop VIP table card (horizontal layout) ── */
.vip-table-card {
    display: flex;
    align-items: center;
}
.vip-table-time {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: rgba(236,236,241,0.5);
    padding: 14px 18px;
    flex-shrink: 0;
    border-right: 1px solid rgba(255,255,255,0.05);
    white-space: nowrap;
    flex-wrap: wrap;
    max-width: 200px;
    row-gap: 3px;
}
.vip-time-sep { color: rgba(236,236,241,0.2); }
.vip-table-card .vip-teams-wrap { flex: 1; padding: 10px 18px; border-right: 1px solid rgba(255,255,255,0.05); }
.vip-table-card > .vip-blur { padding: 10px 18px; border-right: 1px solid rgba(255,255,255,0.05); flex-shrink: 0; }
.vip-table-card .vip-card-cta { padding: 10px 18px; border-top: none; flex-shrink: 0; }
.vip-stats-row { display: flex; align-items: center; gap: 14px; font-size: 13px; }
.vip-stat { color: rgba(236,236,241,0.7); font-weight: 500; }

/* Inline Premium Tip pill (desktop table prediction cell) */
.vip-pill-inline {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(8,24,60,0.9);
    color: #4da6ff;
    border: 1px solid rgba(77,166,255,0.35);
    border-radius: 20px;
    padding: 5px 12px;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}
