/* NBA Predictions App Styles */
:root {
    --navy: #17408B;
    --navy-dark: #0E2240;
    --red: #C8102E;
    --white: #ffffff;
    --gray-light: #f5f5f5;
    --gray: #e0e0e0;
    --gray-dark: #666;
    --green: #2e7d32;
    --green-light: #e8f5e9;
    --text: #1a1a1a;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-light);
    color: var(--text);
    line-height: 1.5;
}

header {
    background: linear-gradient(135deg, var(--navy-dark), var(--navy));
    color: var(--white);
    padding: 2rem 1rem;
    text-align: center;
}

header h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
}

header .subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-top: 0.3rem;
}

header .updated {
    font-size: 0.85rem;
    opacity: 0.7;
    margin-top: 0.5rem;
}

main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.5rem 1rem;
}

/* Controls */
.controls {
    display: flex;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.date-picker {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.date-picker input[type="date"] {
    padding: 0.5rem 0.75rem;
    border: 2px solid var(--gray);
    border-radius: 8px;
    font-size: 0.95rem;
    background: var(--white);
}

.btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-refresh {
    background: var(--navy);
    color: var(--white);
}

.btn-refresh:hover {
    background: var(--navy-dark);
    transform: translateY(-1px);
}

.btn-date {
    background: var(--red);
    color: var(--white);
}

.btn-date:hover {
    opacity: 0.9;
}

.btn-details {
    background: transparent;
    color: var(--navy);
    border: 1px solid var(--gray);
    font-size: 0.85rem;
    padding: 0.4rem 0.8rem;
    margin-top: 0.75rem;
    width: 100%;
}

.btn-details:hover {
    background: var(--gray-light);
}

/* Games Grid */
.games-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.25rem;
}

/* Game Card */
.game-card {
    background: var(--white);
    border-radius: 12px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: box-shadow 0.2s;
}

.game-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.game-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.game-status {
    font-size: 0.8rem;
    color: var(--gray-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.confidence-badge {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--navy);
    background: rgba(23, 64, 139, 0.1);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
}

/* Matchup */
.matchup {
    display: flex;
    align-items: stretch;
    gap: 0;
}

.team {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 0.6rem 0.4rem;
    border-radius: 8px;
    transition: background 0.2s;
}

.team.winner {
    background: var(--green-light);
    border: 2px solid var(--green);
}

.team-logo {
    width: 36px;
    height: 36px;
    object-fit: contain;
    margin-bottom: 0.2rem;
}

.team-abbr {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--team-color, var(--navy));
}

.team-name {
    font-size: 0.7rem;
    color: var(--gray-dark);
    text-align: center;
    margin-top: 0.1rem;
}

.team-record {
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 0.2rem;
}

.winner-tag {
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--green);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.4rem;
    background: rgba(46, 125, 50, 0.1);
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
}

.vs-separator {
    display: flex;
    align-items: center;
    padding: 0 0.75rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--gray-dark);
}

/* Confidence Bar */
.confidence-bar {
    height: 6px;
    background: var(--gray);
    border-radius: 3px;
    margin-top: 1rem;
    overflow: hidden;
}

.confidence-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--navy), var(--green));
    border-radius: 3px;
    transition: width 0.5s ease;
}

/* Details Section */
.details {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--gray);
}

.stats-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.stats-table th {
    text-align: left;
    padding: 0.4rem 0.5rem;
    border-bottom: 2px solid var(--navy);
    color: var(--navy);
    font-weight: 700;
}

.stats-table td {
    padding: 0.35rem 0.5rem;
    border-bottom: 1px solid var(--gray);
}

.stats-table tr:last-child td {
    border-bottom: none;
    font-weight: 700;
}

.positive {
    color: var(--green);
    font-weight: 600;
}

.negative {
    color: var(--red);
    font-weight: 600;
}

/* Injuries */
.injuries {
    margin-bottom: 1rem;
}

.injuries h4 {
    font-size: 0.85rem;
    color: var(--red);
    margin-bottom: 0.3rem;
}

.injuries p {
    font-size: 0.8rem;
    color: var(--gray-dark);
    margin-bottom: 0.2rem;
}

/* Factor Weights */
.factor-weights h4 {
    font-size: 0.85rem;
    color: var(--navy);
    margin-bottom: 0.5rem;
}

.weight-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.3rem;
    font-size: 0.75rem;
}

.weight-label {
    width: 130px;
    color: var(--gray-dark);
    flex-shrink: 0;
}

.weight-bar-bg {
    flex: 1;
    height: 8px;
    background: var(--gray);
    border-radius: 4px;
    overflow: hidden;
}

.weight-bar-fill {
    height: 100%;
    background: var(--navy);
    border-radius: 4px;
}

.weight-value {
    width: 30px;
    text-align: right;
    font-weight: 600;
    color: var(--navy);
}

/* Error Banner */
.error-banner {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
    color: #856404;
    font-size: 0.9rem;
}

.error-banner p {
    margin-top: 0.3rem;
    font-size: 0.85rem;
}

/* No Games */
.no-games {
    text-align: center;
    padding: 4rem 2rem;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.no-games h2 {
    color: var(--navy);
    margin-bottom: 0.5rem;
}

.no-games p {
    color: var(--gray-dark);
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--gray-dark);
    font-size: 0.8rem;
}

footer p {
    margin-bottom: 0.3rem;
}

/* Loading state */
.loading .btn-refresh {
    opacity: 0.6;
    pointer-events: none;
}

.loading .btn-refresh::after {
    content: '...';
}

/* Responsive */
@media (max-width: 500px) {
    .games-grid {
        grid-template-columns: 1fr;
    }

    .team-abbr {
        font-size: 1.4rem;
    }

    header h1 {
        font-size: 1.5rem;
    }

    .controls {
        flex-direction: column;
    }
}
