:root {
    --primary-color: #1a1a2e;
    --secondary-color: #16213e;
    --accent-color: #0f3460;
    --highlight-color: #e94560;
    --text-color: #eee;
    --text-secondary: #aaa;
    --card-bg: #16213e;
    --border-radius: 12px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

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

/* Fix iOS Safari overscroll white background */
html {
    background-color: var(--primary-color);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--accent-color) 100%);
    background-attachment: fixed; /* Keeps gradient fixed during scroll */
    color: var(--text-color);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
}

header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: var(--text-color);
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1.1rem;
}

.dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.tile {
    background: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tile:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 12px rgba(0, 0, 0, 0.4);
}

.tile-header {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--highlight-color) 100%);
    padding: 20px;
    border-bottom: 2px solid var(--highlight-color);
}

.tile-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

.tile-content {
    padding: 30px;
    min-height: 200px;
}

.loading {
    text-align: center;
    color: var(--text-secondary);
    font-size: 1.1rem;
    padding: 40px;
}

.error {
    background: rgba(233, 69, 96, 0.2);
    border: 1px solid var(--highlight-color);
    border-radius: 8px;
    padding: 20px;
    color: var(--text-color);
}

/* FC Barcelona Match Styles */
.match-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.match-teams {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.team {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.team-logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
    background: white;
    border-radius: 50%;
    padding: 10px;
}

.team-name {
    font-size: 1.1rem;
    font-weight: 600;
    text-align: center;
}

.vs {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-secondary);
}

/* F1 Grand Prix Styles */
.f1-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.gp-name {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--highlight-color);
    text-align: center;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.gp-details {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.gp-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
}

.gp-detail-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.gp-detail-value {
    font-size: 1.2rem;
    font-weight: 600;
}

.gp-circuit {
    font-size: 1rem;
    color: var(--text-secondary);
    text-align: center;
    padding: 10px;
    font-style: italic;
}

footer {
    text-align: center;
    color: var(--text-secondary);
    padding: 20px;
    font-size: 0.9rem;
}

#last-updated {
    color: var(--text-color);
    font-weight: 600;
}

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

    header h1 {
        font-size: 2rem;
    }

    .match-teams {
        flex-direction: column;
    }

    .vs {
        transform: rotate(90deg);
    }

    .team-logo {
        width: 60px;
        height: 60px;
    }

    /* F1 race details spacing for mobile */
    .gp-detail-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 18px;
    }

    .gp-detail-label {
        font-size: 0.85rem;
    }

    .gp-detail-value {
        font-size: 1.3rem;
        width: 100%;
    }
}
