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

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

.table-container {
    width: 100%;
    overflow: hidden;
}

/* ============================================
   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%;
        margin: 0 auto;
        padding: 20px 40px;
    }

    .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;
    }
}

.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: block;
    width: 100%;
}

@media (min-width: 1024px) {
    .mobile-cards {
        display: none;
    }
}

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

.match-card:last-child {
    margin-bottom: 0;
}

/* 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 {
    position: absolute;
    top: -6px;
    right: -6px;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 700;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   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;
    }
}
