:root {
    --primary: #0f172a;
    --secondary: #1e293b;
    --accent: #38bdf8;
    --accent-glow: rgba(56, 189, 248, 0.4);
    --text: #f8fafc;
    --text-muted: #94a3b8;
    --success: #4ade80;
    --danger: #f87171;
    --card-bg: rgba(30, 41, 59, 0.7);
    --card-border: rgba(255, 255, 255, 0.1);
    --sidebar-width: 280px;
    --font-main: 'Outfit', sans-serif;
}

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

body {
    font-family: var(--font-main);
    background-color: var(--primary);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('messi_barcelona.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    opacity: 0.15;
    z-index: -1;
    filter: grayscale(50%) contrast(120%);
}

.app-layout {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: rgba(15, 23, 42, 0.95);
    border-right: 1px solid var(--card-border);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    backdrop-filter: blur(10px);
    z-index: 100;
}

.sidebar-header {
    margin-bottom: 3rem;
}

.sidebar-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, var(--accent) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.sidebar-nav ul {
    list-style: none;
}

.sidebar-nav li {
    margin-bottom: 0.5rem;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    padding: 0.8rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.sidebar-nav a:hover, .sidebar-nav a.active {
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent);
}

.sidebar-nav .icon {
    margin-right: 1rem;
    font-size: 1.2rem;
}

.sidebar-footer {
    margin-top: auto;
    padding-top: 2rem;
    border-top: 1px solid var(--card-border);
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem 3rem;
    max-width: calc(100% - var(--sidebar-width));
}

/* Header */
header {
    margin-bottom: 3rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--card-border);
    animation: fadeInDown 0.8s ease-out;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, var(--accent) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.2rem;
    letter-spacing: -1px;
}

.header-content p {
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 300;
}

.btn {
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    display: inline-block;
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
    width: 100%;
    text-align: center;
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(5px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--accent);
    transform: translateY(-2px);
}

/* Hero Section */
.hero {
    margin-bottom: 4rem;
    animation: fadeIn 1s ease-out 0.2s backwards;
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(135deg, rgba(30, 41, 59, 0.8) 0%, rgba(15, 23, 42, 0.9) 100%);
    border-radius: 24px;
    padding: 3rem;
    border: 1px solid var(--card-border);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.hero-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at top right, var(--accent-glow), transparent 60%);
    pointer-events: none;
}

.hero-text {
    flex: 1;
    padding-right: 2rem;
    z-index: 2;
}

.hero-text h2 {
    font-size: 3.5rem;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: #fff;
}

.hero-text p {
    font-size: 1.2rem;
    color: var(--text-muted);
    max-width: 500px;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    z-index: 2;
}

.messi-img {
    max-width: 100%;
    height: auto;
    max-height: 350px;
    filter: drop-shadow(0 0 20px rgba(56, 189, 248, 0.3));
    transition: transform 0.5s ease;
}

.hero-content:hover .messi-img {
    transform: scale(1.05) rotate(2deg);
}

/* Stats Summary */
.stats-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 4rem;
    animation: fadeInUp 0.8s ease-out 0.4s backwards;
}

.stat-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 2rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.03), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.stat-card:hover::after {
    transform: translateX(100%);
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    border-color: var(--accent);
}

.stat-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 0.8rem;
    font-weight: 600;
}

.stat-value {
    font-size: 3rem;
    font-weight: 700;
    background: linear-gradient(135deg, #fff 0%, var(--accent) 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Matches Section */
.matches-container {
    animation: fadeInUp 0.8s ease-out 0.6s backwards;
}

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

.section-header h2 {
    font-size: 2rem;
    font-weight: 600;
}

/* Custom Select */
.select-wrapper {
    position: relative;
}

.select-wrapper::after {
    content: '▼';
    font-size: 0.8rem;
    color: var(--accent);
    position: absolute;
    right: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

select {
    appearance: none;
    -webkit-appearance: none;
    background: rgba(30, 41, 59, 0.8);
    color: var(--text);
    border: 1px solid var(--card-border);
    padding: 0.8rem 3rem 0.8rem 1.5rem;
    border-radius: 12px;
    font-family: var(--font-main);
    font-size: 0.95rem;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    min-width: 150px;
}

select:hover, select:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.1);
    background: rgba(30, 41, 59, 0.95);
}

.matches-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.match-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    backdrop-filter: blur(10px);
}

.match-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    background: rgba(30, 41, 59, 0.9);
}

.match-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1.2rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.8rem;
}

.match-teams {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1.2rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.team {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.score {
    color: var(--accent);
    font-size: 1.2rem;
    font-weight: 700;
    background: rgba(56, 189, 248, 0.1);
    padding: 0.2rem 0.6rem;
    border-radius: 6px;
    min-width: 30px;
    text-align: center;
}

.match-details {
    display: flex;
    gap: 0.8rem;
    margin-top: 1rem;
    font-size: 0.85rem;
}

.tag {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
}

.tag.highlight {
    background: rgba(56, 189, 248, 0.1);
    color: var(--accent);
    border-color: rgba(56, 189, 248, 0.2);
}

/* Loading State */
.loading {
    animation: pulse 1.5s infinite;
    background: linear-gradient(90deg, var(--secondary) 0%, #2d3b4e 50%, var(--secondary) 100%);
    background-size: 200% 100%;
    min-height: 180px;
    border: none;
}

@keyframes pulse {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

footer {
    margin-top: 5rem;
    text-align: center;
    color: var(--text-muted);
    padding-top: 2rem;
    border-top: 1px solid var(--card-border);
    font-size: 0.9rem;
}

/* Grid Lists for Teams/Competitions/Opponents */
.grid-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
    animation: fadeInUp 0.8s ease-out;
}

.grid-item {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
}

.grid-item:hover {
    background: rgba(56, 189, 248, 0.1);
    border-color: var(--accent);
    transform: translateY(-3px);
}

.grid-item h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text);
}

.grid-item p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 240px;
    }
    .main-content {
        padding: 2rem;
    }
}

@media (max-width: 768px) {
    .app-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        padding: 1rem;
        border-right: none;
        border-bottom: 1px solid var(--card-border);
    }

    .sidebar-header {
        margin-bottom: 1rem;
        text-align: center;
    }

    .sidebar-nav ul {
        display: flex;
        overflow-x: auto;
        gap: 0.5rem;
        padding-bottom: 0.5rem;
    }

    .sidebar-nav li {
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .sidebar-footer {
        display: none;
    }

    .main-content {
        margin-left: 0;
        max-width: 100%;
        padding: 1.5rem;
    }

    .hero-content {
        flex-direction: column-reverse;
        text-align: center;
        padding: 2rem;
    }

    .hero-text {
        padding-right: 0;
        margin-top: 2rem;
    }

    .hero-text h2 {
        font-size: 2.5rem;
    }
    
    h1 {
        font-size: 1.8rem;
    }
}
