/* ===================================
   FOOTBALL API DEMO - STYLESHEET
   This file styles our football results app
   =================================== */

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    min-height: 100vh;
    color: #e2e8f0;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

/* ===================================
   HEADER SECTION
   =================================== */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 30px 20px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #60a5fa 0%, #a78bfa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.subtitle {
    font-size: 1.1rem;
    color: #94a3b8;
    font-weight: 400;
}

/* ===================================
   CONTROL PANEL
   =================================== */
.control-panel {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 30px;
    margin-bottom: 30px;
}

.control-panel h2 {
    margin-bottom: 10px;
    color: #f1f5f9;
    font-size: 1.4rem;
}

.control-description {
    color: #94a3b8;
    margin-bottom: 20px;
    line-height: 1.5;
}

/* League Selector */
.league-selector {
    margin-bottom: 25px;
    gap: 12px;
}

.league-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.league-option:hover {
    background: rgba(96, 165, 250, 0.1);
    border-color: rgba(96, 165, 250, 0.3);
}

.league-option input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #60a5fa;
}

.league-option span {
    color: #e2e8f0;
    font-size: 0.9rem;
    font-weight: 500;
}

.league-option:has(input:checked) {
    background: rgba(96, 165, 250, 0.15);
    border-color: rgba(96, 165, 250, 0.4);
}

/* Fetch button */
.fetch-btn {
    width: 100%;
    padding: 16px 24px;
    font-size: 1.1rem;
    font-weight: 600;
    background: linear-gradient(135deg, #3b82f6 0%, #8b5cf6 100%);
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.fetch-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(59, 130, 246, 0.4);
}

.fetch-btn:active {
    transform: translateY(0);
}

.fetch-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ===================================
   LOADING SPINNER
   =================================== */
.loading {
    text-align: center;
    padding: 40px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    margin-bottom: 20px;
}

.spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 4px solid rgba(96, 165, 250, 0.2);
    border-top-color: #60a5fa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ===================================
   ERROR MESSAGE
   =================================== */
.error-message {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
}

.error-message h3 {
    color: #fca5a5;
    margin-bottom: 10px;
}

.error-message p {
    color: #fecaca;
}

/* ===================================
   RESULTS CONTAINER - TABLE STYLE
   =================================== */
.results-container {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 40px;
}

.fixtures-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.fixtures-table thead {
    background: rgba(96, 165, 250, 0.1);
    border-bottom: 2px solid rgba(96, 165, 250, 0.3);
}

.fixtures-table th {
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    color: #60a5fa;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fixtures-table th.center {
    text-align: center;
}

.fixtures-table tbody tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: background-color 0.2s ease;
}

.fixtures-table tbody tr:hover {
    background: rgba(96, 165, 250, 0.08);
}

.fixtures-table tbody tr:last-child {
    border-bottom: none;
}

.fixtures-table td {
    padding: 14px 12px;
    color: #e2e8f0;
    vertical-align: middle;
}

.league-cell {
    font-weight: 600;
    color: #60a5fa;
    white-space: nowrap;
}

.datetime-cell {
    color: #94a3b8;
    font-size: 0.85rem;
    white-space: nowrap;
}

.date-line {
    display: block;
    margin-bottom: 2px;
}

.time-line {
    display: block;
    font-size: 0.8rem;
    color: #64748b;
}

.team-cell {
    display: flex;
    align-items: center;
    gap: 8px;
}

.team-logo {
    width: 24px;
    height: 24px;
    object-fit: contain;
    flex-shrink: 0;
}

.team-name {
    font-weight: 500;
    color: #f1f5f9;
}

.score-cell {
    text-align: center;
    font-weight: 700;
    font-size: 1.1rem;
    color: #60a5fa;
    white-space: nowrap;
}

.score-cell.no-score {
    color: #64748b;
    font-size: 0.9rem;
}

.venue-cell {
    color: #94a3b8;
    font-size: 0.85rem;
}

.match-status {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    text-align: center;
    white-space: nowrap;
}

.status-finished {
    background: rgba(34, 197, 94, 0.2);
    color: #86efac;
}

.status-live {
    background: rgba(239, 68, 68, 0.2);
    color: #fca5a5;
}

.status-scheduled {
    background: rgba(59, 130, 246, 0.2);
    color: #93c5fd;
}

/* ===================================
   FOOTER
   =================================== */
.footer {
    text-align: center;
    padding: 30px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    margin-top: 40px;
}

.footer h3 {
    color: #a78bfa;
    margin-bottom: 10px;
}

.footer p {
    color: #cbd5e1;
}

/* ===================================
   UTILITY CLASSES
   =================================== */
.hidden {
    display: none;
}

/* ===================================
   RESPONSIVE DESIGN
   =================================== */
@media (max-width: 768px) {
    .header h1 {
        font-size: 2rem;
    }

    .fixtures-table {
        font-size: 0.8rem;
    }

    .fixtures-table th,
    .fixtures-table td {
        padding: 10px 8px;
    }

    .team-logo {
        width: 20px;
        height: 20px;
    }

    .control-panel {
        padding: 20px;
    }

    .league-options {
        grid-template-columns: 1fr;
    }
}
/* ===================================
   API USAGE COUNTER
   =================================== */
.api-counter {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 20px 24px;
    margin-bottom: 30px;
}

.counter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.counter-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #f1f5f9;
}

.counter-reset {
    font-size: 0.8rem;
    color: #94a3b8;
}

.progress-bar-container {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 12px;
}

.progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #10b981 0%, #3b82f6 100%);
    border-radius: 10px;
    transition: width 0.3s ease, background 0.3s ease;
    width: 0%;
}

.progress-bar.medium {
    background: linear-gradient(90deg, #3b82f6 0%, #f59e0b 100%);
}

.progress-bar.high {
    background: linear-gradient(90deg, #f59e0b 0%, #ef4444 100%);
}

.counter-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.counter-used {
    font-weight: 600;
    color: #60a5fa;
}

.counter-remaining {
    color: #94a3b8;
}

.counter-warning {
    margin-top: 12px;
    padding: 8px 12px;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    border-radius: 8px;
    font-size: 0.85rem;
    color: #fbbf24;
    display: flex;
    align-items: center;
    gap: 6px;
}

.counter-warning.error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

/* Info icon tooltip */
.info-icon {
    display: inline-block;
    margin-left: 6px;
    font-size: 0.85rem;
    cursor: help;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.info-icon:hover {
    opacity: 1;
}

/* Utility class for hiding elements */
.hidden {
    display: none !important;
}
