:root {
    --bg-color: #080b11;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --accent-color: #eab308; /* Gold color for World Cup feel */
    --card-bg: rgba(15, 23, 42, 0.65);
    --card-border: rgba(255, 255, 255, 0.07);
    --glass-blur: blur(20px);
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    background-image: 
        radial-gradient(circle at 5% 15%, rgba(234, 179, 8, 0.08), transparent 35%),
        radial-gradient(circle at 95% 85%, rgba(56, 189, 248, 0.08), transparent 35%);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

.app-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem 3rem 2rem;
}

/* Wide Banner Responsive Container */
.banner-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    line-height: 0; /* Prevents tiny whitespace at the bottom of inline elements */
}

.banner-img {
    width: 100%;
    height: auto;
    display: block;
    filter: brightness(0.85) contrast(1.05); /* Enhance visibility of players */
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        to bottom,
        rgba(8, 11, 17, 0) 60%,
        rgba(8, 11, 17, 0.5) 85%,
        var(--bg-color) 100%
    );
    pointer-events: none;
}

/* Header Section Below Banner */
.header-section {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 3rem;
    max-width: 1200px;
    margin: -3.5rem auto 4rem auto; /* Overlaps with the bottom black fade gradient */
    padding: 1rem 2rem;
    z-index: 10;
}

.header-logo {
    height: 140px;
    object-fit: contain;
    filter: drop-shadow(0 8px 16px rgba(0, 0, 0, 0.6)) drop-shadow(0 0 25px rgba(234, 179, 8, 0.25));
    animation: floatLogo 6s ease-in-out infinite;
}

@keyframes floatLogo {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.header-text {
    display: flex;
    flex-direction: column;
}

.glow-text {
    font-size: 4.5rem;
    font-weight: 900;
    letter-spacing: 1px;
    background: linear-gradient(135deg, #ffffff 10%, #fef08a 50%, #eab308 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    text-transform: uppercase;
    text-shadow: 0 0 35px rgba(234, 179, 8, 0.35);
    line-height: 1.1;
    margin-bottom: 0.6rem;
}

.header-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 5px;
    font-weight: 600;
    border-left: 4px solid var(--accent-color);
    padding-left: 1rem;
}

/* Sections */
.section {
    margin-bottom: 5rem;
}

.section-title {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 2.5rem;
    border-left: 6px solid var(--accent-color);
    padding-left: 1.2rem;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

/* Players Carousel Wrapper */
.carousel-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.players-carousel {
    display: flex;
    gap: 2rem;
    overflow-x: auto;
    width: 100%;
    padding: 1rem 0.5rem 3rem 0.5rem;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    scroll-behavior: smooth;
}

.players-carousel::-webkit-scrollbar {
    display: none;
}

/* Carousel Buttons */
.carousel-btn {
    position: absolute;
    top: calc(50% - 25px);
    width: 55px;
    height: 55px;
    border-radius: 50%;
    background: rgba(15, 23, 42, 0.75);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--accent-color);
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    backdrop-filter: blur(8px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.5);
}

.carousel-btn:hover {
    background: var(--accent-color);
    color: #000;
    border-color: var(--accent-color);
    transform: scale(1.1);
    box-shadow: 0 12px 24px rgba(234, 179, 8, 0.3);
}

.prev-btn {
    left: -20px;
}

.next-btn {
    right: -20px;
}

.player-card {
    flex: 0 0 310px;
    height: 440px;
    border-radius: 28px;
    position: relative;
    overflow: hidden;
    scroll-snap-align: start;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid var(--card-border);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5);
}

.player-card:hover {
    transform: translateY(-12px);
    border-color: rgba(234, 179, 8, 0.5);
    box-shadow: 0 25px 50px rgba(234, 179, 8, 0.2);
}

.player-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.player-card:hover .player-img {
    transform: scale(1.08);
}

.player-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 3.5rem 1.8rem 1.8rem;
    background: linear-gradient(to top, rgba(8, 11, 17, 1) 0%, rgba(8, 11, 17, 0.85) 50%, transparent 100%);
}

.player-name {
    font-size: 1.7rem;
    font-weight: 800;
    margin-bottom: 0.25rem;
    color: #fff;
    letter-spacing: 0.5px;
}

.player-country {
    font-size: 1rem;
    color: var(--accent-color);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.captain-badge {
    font-size: 0.9rem;
    background: var(--accent-color);
    color: #000;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-weight: bold;
    margin-left: 0.5rem;
    vertical-align: middle;
}

/* Grouped Teams Layout */
.teams-grid {
    display: flex;
    flex-direction: column;
    gap: 3.5rem;
}

.group-container {
    background: rgba(15, 23, 42, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.03);
    border-radius: 24px;
    padding: 2rem;
    backdrop-filter: blur(5px);
}

.group-title {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--accent-color);
    margin-bottom: 1.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    display: inline-block;
    border-bottom: 3px solid rgba(234, 179, 8, 0.6);
    padding-bottom: 0.3rem;
}

.group-teams-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* Exactly 4 teams on desktop */
    gap: 1.5rem;
}

.team-card {
    background: var(--card-bg);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--card-border);
    border-radius: 20px;
    padding: 2rem 1.2rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
    transition: all 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    cursor: pointer;
}

.team-card:hover {
    background: rgba(15, 23, 42, 0.85);
    border-color: rgba(234, 179, 8, 0.4);
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.4), 0 0 25px rgba(234, 179, 8, 0.08);
}

.team-flag {
    width: 75px;
    height: 50px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.4);
    transition: transform 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.team-card:hover .team-flag {
    transform: scale(1.15) rotate(3deg);
}

.team-name {
    font-size: 1.2rem;
    font-weight: 700;
    text-align: center;
    color: #f1f5f9;
}

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(8, 11, 17, 0.9);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: rgba(15, 23, 42, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 32px;
    width: 90%;
    max-width: 950px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.1);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
}

.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-primary);
    font-size: 2rem;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s;
}

.modal-close:hover {
    background: rgba(234, 179, 8, 0.2);
    color: var(--accent-color);
    transform: rotate(90deg) scale(1.05);
}

/* Modal Body Layout (Players) */
.modal-grid {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    min-height: 500px;
}

.modal-left {
    position: relative;
    height: 100%;
    min-height: 450px;
}

.modal-left img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-left-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to right, transparent, rgba(15, 23, 42, 1));
}

.modal-right {
    padding: 3rem;
    overflow-y: auto;
}

.modal-player-name {
    font-size: 2.4rem;
    font-weight: 900;
    margin-bottom: 0.2rem;
    background: linear-gradient(to right, #ffffff, #eab308);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.modal-player-meta {
    font-size: 1.1rem;
    color: var(--accent-color);
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 2rem;
    letter-spacing: 1px;
}

.info-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
}

.info-table tr {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.info-table td {
    padding: 0.8rem 0;
}

.info-table td.label {
    color: var(--text-secondary);
    font-weight: 500;
    width: 35%;
}

.info-table td.val {
    color: var(--text-primary);
    font-weight: 700;
}

.modal-section-title {
    font-size: 1.35rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--accent-color);
    border-bottom: 1px solid rgba(234, 179, 8, 0.25);
    padding-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modal-text-block {
    margin-bottom: 1.8rem;
    color: #e2e8f0;
    font-size: 0.98rem;
    line-height: 1.6;
}

.fun-facts-list {
    padding-left: 1.2rem;
    margin-bottom: 1.8rem;
}

.fun-facts-list li {
    margin-bottom: 0.6rem;
    color: #e2e8f0;
    font-size: 0.98rem;
}

/* Modal Body Layout (Teams/Squads) */
.team-modal-container {
    padding: 3rem;
}

.team-modal-header {
    display: flex;
    align-items: center;
    gap: 2rem;
    margin-bottom: 2.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 1.5rem 2rem;
    border-radius: 20px;
}

.team-modal-flag {
    width: 110px;
    height: 73px;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.15);
}

.team-modal-title-box {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.team-modal-name {
    font-size: 2.6rem;
    font-weight: 900;
    color: #fff;
    line-height: 1.1;
    letter-spacing: 0.5px;
}

.team-modal-group-badge {
    align-self: flex-start;
    font-size: 0.95rem;
    color: var(--accent-color);
    background: rgba(234, 179, 8, 0.15);
    border: 1px solid rgba(234, 179, 8, 0.3);
    padding: 0.25rem 0.8rem;
    border-radius: 30px;
    font-weight: 700;
    text-transform: uppercase;
}

.team-squad-layout {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

.squad-position-block {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
}

.squad-position-title {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--accent-color);
    margin-bottom: 1rem;
    border-left: 4px solid var(--accent-color);
    padding-left: 0.8rem;
}

.squad-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.squad-list li {
    font-size: 0.98rem;
    color: #cbd5e1;
    padding: 0.3rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.02);
    transition: color 0.2s;
}

.squad-list li:hover {
    color: #fff;
}

/* Footer */
footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    text-align: center;
    padding: 3rem 0;
    color: var(--text-secondary);
    border-top: 1px solid var(--card-border);
    margin-top: 5rem;
}

.footer-logo img {
    height: 70px;
    object-fit: contain;
    filter: drop-shadow(0 4px 8px rgba(0,0,0,0.5));
}

/* Responsive Styles */
.group-teams-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.5rem;
}

@media (min-width: 1025px) {
    .group-teams-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 1024px) {
    .header-section {
        gap: 2rem;
        margin-top: -1.5rem;
    }
    .header-logo {
        height: 110px;
    }
    .glow-text {
        font-size: 3.5rem;
    }
    .header-subtitle {
        font-size: 1.15rem;
        letter-spacing: 4px;
    }
    .modal-grid {
        grid-template-columns: 1fr;
    }
    .modal-left {
        height: 350px;
        min-height: auto;
    }
    .modal-left-overlay {
        background: linear-gradient(to top, rgba(15, 23, 42, 1), transparent);
    }
    .modal-right {
        padding: 2.2rem;
    }
    .team-squad-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-section {
        flex-direction: column;
        text-align: center;
        gap: 1.5rem;
        margin-top: 0;
        padding-top: 2rem;
    }
    .header-subtitle {
        border-left: none;
        padding-left: 0;
    }
    .glow-text {
        font-size: 2.8rem;
    }
    .prev-btn {
        left: 0;
    }
    .next-btn {
        right: 0;
    }
    .carousel-btn {
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
        top: calc(50% - 22.5px);
    }
    .player-card {
        flex: 0 0 280px;
        height: 390px;
    }
    .group-container {
        padding: 1.5rem;
    }
    .group-teams-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.85rem;
    }
    .team-card {
        padding: 1.2rem 0.8rem;
    }
    .team-name {
        font-size: 1rem;
    }
    .team-flag {
        width: 60px;
        height: 40px;
    }
    .team-modal-container {
        padding: 1.5rem;
    }
    .team-modal-header {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
        padding: 1.2rem;
    }
    .team-modal-name {
        font-size: 2rem;
    }
    .team-modal-group-badge {
        align-self: center;
    }
}
