/* ==============================================
   SWISS JUNIORS CUP - RESPONSIVE CSS
   Mobile-First Approach with Breakpoints:
   - Base: 0-479px (Mobile Small)
   - 480px: Mobile Large
   - 768px: Tablet
   - 1024px: Desktop Small
   - 1440px: Desktop Large
   ============================================== */

/* ===== CSS CUSTOM PROPERTIES FOR RESPONSIVE ===== */
:root {
    --spacing-xs: 8px;
    --spacing-sm: 12px;
    --spacing-md: 20px;
    --spacing-lg: 32px;
    --spacing-xl: 48px;
    --spacing-xxl: 80px;

    /* Touch-friendly tap targets */
    --tap-target-min: 44px;

    /* Container padding responsive */
    --container-padding: 16px;
}

/* ===== BASE MOBILE STYLES (0-479px) ===== */

/* Global Reset for Responsive */
*, *::before, *::after {
    box-sizing: border-box;
}

/* Prevent horizontal scroll */
html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

/* All images and iframes responsive by default */
img, iframe, video {
    max-width: 100%;
    height: auto;
}

/* Base font size for readability */
body {
    font-size: 15px;
    line-height: 1.6;
}

/* ===== HEADER & NAVIGATION - MOBILE ===== */
.header {
    padding: 10px 0;
}

.header-container {
    padding: 0 var(--container-padding);
    flex-wrap: wrap;
}

.header-brand {
    gap: 10px;
}

.logo {
    height: 50px !important;
}

.header-edition {
    display: none;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: var(--tap-target-min);
    height: var(--tap-target-min);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    z-index: 1100;
    padding: 10px;
    gap: 5px;
}

.hamburger-line {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 2px;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Navigation Overlay */
.mobile-menu-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-menu-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Mobile Navigation */
.nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 320px;
    height: 100vh;
    background: var(--bg-secondary);
    flex-direction: column;
    align-items: stretch;
    padding: 80px 20px 30px;
    gap: 0;
    z-index: 1050;
    overflow-y: auto;
    transition: right 0.3s ease;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.2);
}

.nav.active {
    right: 0;
}

.nav a {
    padding: 14px 16px;
    font-size: 0.95rem;
    border-radius: 10px;
    margin-bottom: 4px;
}

.nav a:hover {
    background: rgba(233, 69, 96, 0.1);
}

.nav a.cta {
    margin-top: 15px;
    justify-content: center;
}

.theme-toggle {
    margin: 20px 0 0;
    align-self: flex-start;
    margin-left: 16px;
}

/* Hide dropdowns on mobile - show as simple links */
.nav-dropdown .dropdown-menu,
.has-megamenu .mega-menu {
    display: none !important;
}

.dropdown-trigger svg {
    display: none;
}

/* ===== HERO SECTION - MOBILE ===== */
.hero {
    min-height: auto;
    padding: 85px 0 40px;
}

.hero-container {
    padding: 0 var(--container-padding);
}

.hero-grid {
    grid-template-columns: 1fr;
    gap: 30px;
}

.hero-content {
    padding-top: 0;
    order: 1;
}

.hero-badge {
    padding: 8px 14px;
    font-size: 0.75rem;
    margin-bottom: 18px;
}

.hero-title {
    font-size: clamp(2.2rem, 10vw, 3.5rem);
    margin-bottom: 15px;
}

.hero-subtitle {
    font-size: 0.95rem;
}

.hero-tagline {
    font-size: 0.85rem;
}

.hero-info {
    flex-direction: column;
    gap: 15px;
    padding: 15px 0;
}

.hero-info-item h4 {
    font-size: 0.6rem;
}

.hero-info-item p {
    font-size: 0.9rem;
}

.hero-cta {
    flex-direction: column;
    gap: 10px;
}

.btn {
    width: 100%;
    justify-content: center;
    padding: 14px 20px;
    font-size: 0.9rem;
    min-height: var(--tap-target-min);
}

.hero-description-box {
    padding: 18px;
    margin-top: 25px;
}

.hero-description-box p {
    font-size: 0.85rem;
}

/* Hero Media - Mobile */
.hero-media {
    order: 2;
    gap: 15px;
}

.hero-video-container {
    height: 180px;
    border-radius: 12px;
}

.hero-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.stat-card {
    padding: 12px 8px;
}

.stat-card h3 {
    font-size: 1.8rem;
}

.stat-card p {
    font-size: 0.55rem;
}

.hero-tv-card {
    border-radius: 12px;
}

.hero-games-left,
.hero-teams-right {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.game-item,
.team-item {
    border-radius: 10px;
}

/* ===== SECTIONS - MOBILE ===== */
.section {
    padding: 50px 0;
}

.container {
    padding: 0 var(--container-padding);
}

.section-header {
    margin-bottom: 35px;
}

.section-label {
    font-size: 0.65rem;
    letter-spacing: 2px;
}

.section-label::before,
.section-label::after {
    width: 20px;
}

.section-title {
    font-size: clamp(1.6rem, 6vw, 2.4rem);
    margin-bottom: 10px;
}

.section-subtitle {
    font-size: 0.85rem;
    padding: 0 5px;
}

/* ===== TWO BLOCKS (ABOUT) - MOBILE ===== */
.two-blocks {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-top: 30px;
}

.block-card {
    padding: 25px 20px;
    border-radius: 16px;
}

.block-card .block-badge {
    position: static;
    display: inline-flex;
    margin-bottom: 15px;
}

.block-card h3 {
    font-size: 1.5rem;
}

.block-card h4 {
    font-size: 0.8rem;
}

.block-card p {
    font-size: 0.85rem;
}

.block-card .block-address {
    padding: 15px;
}

.block-card .block-address p {
    font-size: 0.8rem;
}

/* ===== CLUBS GRID - MOBILE ===== */
.clubs-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.club-card {
    padding: 25px 12px 18px;
    border-radius: 14px;
}

.club-logo {
    width: 65px;
    height: 65px;
    margin-bottom: 10px;
}

.club-name {
    font-size: 1rem;
}

.club-country {
    font-size: 0.7rem;
}

.club-badge {
    font-size: 0.5rem;
    padding: 3px 8px;
}

.club-action {
    font-size: 0.6rem;
    padding: 4px 10px;
}

.academies-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.academy-card {
    padding: 22px 10px 15px;
}

.academy-logo {
    width: 50px;
    height: 50px;
}

.academy-name {
    font-size: 0.85rem;
}

/* ===== PROGRAM SECTION - MOBILE ===== */
.program-description {
    font-size: 0.85rem;
    padding: 0 10px;
}

.program-tabs {
    gap: 6px;
    padding: 0 5px;
}

.program-tab {
    padding: 8px 12px;
    font-size: 0.7rem;
    border-radius: 20px;
}

.program-tab svg {
    width: 12px;
    height: 12px;
}

.program-tab .count {
    padding: 2px 5px;
    font-size: 0.6rem;
}

.team-filter-wrapper {
    flex-direction: column;
    padding: 12px 15px;
    max-width: 100%;
}

.team-filter-wrapper select {
    width: 100%;
}

/* Matches Grid - Mobile */
.matches-grid {
    max-height: 500px;
    padding-right: 8px;
}

.match-row {
    grid-template-columns: 50px 1fr 40px 1fr 60px;
    gap: 6px;
    padding: 10px 12px;
}

/* Hide arbitres on mobile */
.match-arbitres {
    display: none;
    font-size: 0.8rem;
}

.match-time .time {
    font-size: 1rem;
}

.match-time .phase {
    font-size: 0.5rem;
}

.match-team img {
    width: 25px;
    height: 25px;
}

.match-team .name {
    font-size: 0.7rem;
}

.match-vs {
    font-size: 0.65rem;
    padding: 4px 8px;
}

.match-badge span {
    font-size: 0.55rem;
    padding: 3px 6px;
}

/* ===== QUALIFICATION SECTION - MOBILE ===== */
.quali-intro {
    font-size: 0.85rem;
}

.quali-description {
    font-size: 0.85rem;
    padding: 0 10px;
}

/* Podium mobile: colonne, gold en premier */
.quali-podium {
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.podium-item {
    width: 100%;
    max-width: 280px;
    padding: 20px;
}

.podium-item.gold {
    transform: scale(1);
    order: -1;
}

.podium-item.silver {
    order: 0;
}

.podium-item.bronze {
    order: 1;
}

.podium-rank {
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
}

.podium-logo {
    width: 50px;
    height: 50px;
}

.podium-name {
    font-size: 0.9rem;
}

/* ===== SPONSORS SECTION - MOBILE ===== */
.sponsors-partners-section {
    margin: 40px 0 25px;
    padding: 35px 0;
}

.sponsors-section-title {
    font-size: 1.6rem;
    letter-spacing: 2px;
}

.sponsor-category {
    padding: 20px 15px;
    margin-bottom: 25px;
    border-radius: 14px;
}

.sponsor-category-title {
    font-size: 1.2rem;
}

.sponsor-category-desc {
    font-size: 0.8rem;
    padding: 0 5px;
}

.sponsor-logos-grid.partenaires-grid,
.sponsor-logos-grid.sponsors-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.sponsor-logos-grid.soutiens-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

/* ===== VENUE SECTION - MOBILE ===== */
.venue-section {
    padding: 60px var(--container-padding);
    background-attachment: scroll;
}

.venue-title {
    font-size: 1.8rem;
    margin-bottom: 40px;
    letter-spacing: 2px;
}

.venue-grid {
    grid-template-columns: 1fr;
    gap: 25px;
}

.venue-card {
    flex-direction: column;
    text-align: center;
    align-items: center;
    padding: 20px 18px;
    border-radius: 16px;
}

.venue-card-icon {
    width: 50px;
    height: 50px;
    min-width: 50px;
}

.venue-card-content h4 {
    font-size: 1rem;
}

.venue-card-content p {
    font-size: 13px;
}

.access-grid {
    justify-content: center;
}

.venue-map {
    min-height: 280px;
}

.map-buttons {
    flex-direction: column;
}

.map-btn {
    padding: 14px;
}

/* ===== CONTACT SECTION - MOBILE ===== */
.contact-section {
    padding: 50px var(--container-padding);
}

.contact-grid {
    grid-template-columns: 1fr;
    gap: 15px;
}

.contact-card {
    padding: 25px 20px;
}

/* ===== FOOTER - MOBILE ===== */
.footer {
    padding: 40px var(--container-padding);
}

.footer-content {
    grid-template-columns: 1fr;
    gap: 30px;
    text-align: center;
}

.footer-logo {
    height: 50px;
}

.footer-text {
    font-size: 0.85rem;
}

.footer-links h4 {
    font-size: 1rem;
    margin-bottom: 12px;
}

.footer-links a {
    display: block;
    padding: 6px 0;
    font-size: 0.85rem;
}

.footer-bottom {
    margin-top: 30px;
    padding-top: 20px;
}

.footer-bottom p {
    font-size: 0.8rem;
}

/* ===== MODALS - MOBILE ===== */
/* Ensure modals are hidden by default */
.modal-overlay,
.photo-modal,
.partner-modal-overlay {
    display: none !important;
    visibility: hidden;
    opacity: 0;
}

.modal-overlay.active,
.photo-modal.active,
.partner-modal-overlay.active {
    display: flex !important;
    visibility: visible;
    opacity: 1;
}

.modal-overlay {
    padding: 15px;
}

.modal-content {
    max-height: 90vh;
    border-radius: 16px;
}

.modal-image {
    height: 150px;
}

.modal-info {
    padding: 20px;
}

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

.modal-name {
    font-size: 1.3rem;
}

/* Photo Modal - Mobile */
.photo-modal img {
    max-width: 95%;
    max-height: 85vh;
}

.photo-modal-close {
    top: 15px;
    right: 15px;
    width: 40px;
    height: 40px;
}

.photo-modal-nav {
    width: 40px;
    height: 40px;
}

.photo-modal-nav.prev {
    left: 10px;
}

.photo-modal-nav.next {
    right: 10px;
}

/* Legal Section - Mobile */
.legal-docs-grid {
    grid-template-columns: 1fr;
}

.legal-doc-viewer {
    height: 300px;
}

/* ===== ORBITAL DESIGN - MOBILE ===== */
.orbital-items {
    gap: 8px;
}

.orbital-item {
    padding: 10px 14px;
}

.orbital-label {
    font-size: 0.75rem;
}

.orbital-icon {
    width: 26px;
    height: 26px;
}

.panel-content {
    grid-template-columns: 1fr;
    padding: 18px;
}

.panel-header h3 {
    font-size: 1.2rem;
}

.panel-image {
    width: 100%;
}

.panel-image img {
    height: 160px;
}

.panel-stats,
.panel-values,
.panel-orga {
    width: 100%;
    grid-template-columns: repeat(2, 1fr);
}


/* ==============================================
   BREAKPOINT: 480px - LARGE MOBILE
   ============================================== */
@media (min-width: 480px) {
    :root {
        --container-padding: 20px;
    }

    body {
        font-size: 15px;
    }

    .logo {
        height: 55px !important;
    }

    .hero-title {
        font-size: clamp(2.5rem, 10vw, 4rem);
    }

    .hero-video-container {
        height: 200px;
    }

    .stat-card h3 {
        font-size: 2rem;
    }

    .stat-card p {
        font-size: 0.6rem;
    }

    .clubs-grid {
        gap: 15px;
    }

    .club-logo {
        width: 75px;
        height: 75px;
    }

    .club-name {
        font-size: 1.1rem;
    }

    .match-row {
        grid-template-columns: 60px 1fr 50px 1fr 70px;
        gap: 8px;
        padding: 12px 15px;
    }

    .match-time .time {
        font-size: 1.2rem;
    }

    .match-team img {
        width: 30px;
        height: 30px;
    }

    .match-team .name {
        font-size: 0.75rem;
    }

    .sponsor-logos-grid.soutiens-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}


/* ==============================================
   BREAKPOINT: 768px - TABLET
   ============================================== */
@media (min-width: 768px) {
    :root {
        --container-padding: 30px;
    }

    body {
        font-size: 16px;
    }

    /* Header */
    .logo {
        height: 60px !important;
    }

    .header-edition {
        display: flex;
    }

    .edition-title {
        font-size: 1rem;
    }

    .edition-subtitle {
        font-size: 0.65rem;
    }

    /* Hero */
    .hero {
        padding: 100px 0 50px;
    }

    .hero-title {
        font-size: clamp(3rem, 8vw, 4.5rem);
    }

    .hero-info {
        flex-direction: row;
        flex-wrap: wrap;
        gap: 25px;
    }

    .hero-cta {
        flex-direction: row;
    }

    .btn {
        width: auto;
    }

    .hero-video-container {
        height: 220px;
    }

    .stat-card h3 {
        font-size: 2.2rem;
    }

    .stat-card p {
        font-size: 0.65rem;
    }

    /* Sections */
    .section {
        padding: 70px 0;
    }

    .section-title {
        font-size: clamp(2rem, 5vw, 2.8rem);
    }

    .section-subtitle {
        font-size: 0.9rem;
    }

    /* Two Blocks */
    .two-blocks {
        grid-template-columns: 1fr 1fr;
        gap: 25px;
    }

    .block-card {
        padding: 30px 25px;
    }

    .block-card .block-badge {
        position: absolute;
        top: 18px;
        right: 18px;
    }

    /* Clubs Grid */
    .clubs-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 18px;
    }

    .club-card {
        padding: 30px 18px 22px;
    }

    .club-logo {
        width: 80px;
        height: 80px;
    }

    .academies-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }

    /* Program */
    .program-tab {
        padding: 10px 18px;
        font-size: 0.75rem;
    }

    .match-row {
        grid-template-columns: 70px 1fr 55px 1fr 80px;
        gap: 10px;
        padding: 14px 18px;
    }

    .match-time .time {
        font-size: 1.3rem;
    }

    .match-team img {
        width: 32px;
        height: 32px;
    }

    .match-team .name {
        font-size: 0.8rem;
    }

    /* Qualification */
    .quali-podium {
        flex-direction: row;
        align-items: flex-start;
    }

    .podium-item {
        width: 160px;
    }

    .podium-item.gold {
        transform: scale(1.08);
        order: 0;
        margin-top: 0;
    }

    .podium-item.silver,
    .podium-item.bronze {
        margin-top: 40px;
    }

    /* Sponsors */
    .sponsor-logos-grid.partenaires-grid,
    .sponsor-logos-grid.sponsors-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    /* Venue */
    .venue-section {
        padding: 80px 4%;
    }

    .venue-title {
        font-size: 2.2rem;
    }

    .venue-card {
        flex-direction: row;
        text-align: left;
        align-items: flex-start;
    }

    .access-grid {
        justify-content: flex-start;
    }

    .map-buttons {
        flex-direction: row;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
        text-align: left;
    }

    /* Legal */
    .legal-docs-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .legal-doc-viewer {
        height: 350px;
    }
}


/* ==============================================
   BREAKPOINT: 1024px - DESKTOP SMALL
   ============================================== */
@media (min-width: 1024px) {
    :root {
        --container-padding: 40px;
    }

    /* Header - Desktop Nav */
    .mobile-menu-toggle {
        display: none;
    }

    .mobile-menu-overlay {
        display: none;
    }

    .nav {
        position: static;
        width: auto;
        height: auto;
        max-width: none;
        background: transparent;
        flex-direction: row;
        padding: 0;
        overflow: visible;
        box-shadow: none;
        gap: 5px;
    }

    .nav a {
        padding: 8px 15px;
        font-size: 0.8rem;
        margin-bottom: 0;
    }

    .nav a.cta {
        margin-top: 0;
    }

    .theme-toggle {
        margin: 0 0 0 10px;
    }

    .logo {
        height: 70px !important;
    }

    .header-edition {
        padding-left: 15px;
    }

    .edition-title {
        font-size: 1.2rem;
    }

    .edition-subtitle {
        font-size: 0.7rem;
    }

    /* Enable Dropdowns & Mega Menus */
    .nav-dropdown .dropdown-menu {
        display: block !important;
        opacity: 0;
        visibility: hidden;
    }

    .nav-dropdown:hover .dropdown-menu {
        opacity: 1;
        visibility: visible;
    }

    .dropdown-trigger svg {
        display: block;
    }

    .has-megamenu .mega-menu {
        display: block !important;
        opacity: 0;
        visibility: hidden;
    }

    .has-megamenu:hover .mega-menu {
        opacity: 1;
        visibility: visible;
    }

    /* Hero */
    .hero {
        min-height: 100vh;
        padding: 100px 0 60px;
    }

    .hero-grid {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }

    .hero-content {
        order: 0;
        padding-top: 10px;
    }

    .hero-media {
        order: 0;
    }

    /* Clubs Grid */
    .clubs-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 20px;
    }

    .club-card {
        padding: 35px 20px 25px;
    }

    .club-logo {
        width: 85px;
        height: 85px;
    }

    /* Program */
    .program-tab {
        padding: 10px 20px;
        font-size: 0.8rem;
    }

    .match-row {
        grid-template-columns: 80px 1fr 60px 1fr 80px 140px;
        gap: 12px;
        padding: 15px 18px;
    }

    /* Show arbitres on desktop */
    .match-arbitres {
        display: block;
    }

    .match-time .time {
        font-size: 1.4rem;
    }

    .match-team img {
        width: 35px;
        height: 35px;
    }

    .match-team .name {
        font-size: 0.85rem;
    }

    /* Podium */
    .podium-item {
        width: 170px;
        padding: 25px;
    }

    .podium-logo {
        width: 55px;
        height: 55px;
    }

    /* Sponsors */
    .sponsor-logos-grid.partenaires-grid,
    .sponsor-logos-grid.sponsors-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    /* Venue */
    .venue-grid {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }

    .venue-title {
        font-size: 2.5rem;
    }

    .venue-map {
        min-height: 380px;
    }

    /* Footer */
    .footer-content {
        grid-template-columns: 1.5fr 1fr 1fr 1fr;
    }

    /* Legal */
    .legal-docs-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .legal-doc-viewer {
        height: 400px;
    }

    /* Orbital Panels */
    .panel-content {
        grid-template-columns: auto 1fr;
        padding: 30px;
    }

    .panel-image {
        width: 280px;
    }

    .panel-image img {
        height: 200px;
    }
}


/* ==============================================
   BREAKPOINT: 1440px - DESKTOP LARGE
   ============================================== */
@media (min-width: 1440px) {
    :root {
        --container-padding: 50px;
    }

    .logo {
        height: 75px !important;
    }

    .edition-title {
        font-size: 1.3rem;
    }

    /* Hero */
    .hero-grid {
        gap: 50px;
    }

    .hero-title {
        font-size: clamp(4rem, 6vw, 5rem);
    }

    .hero-video-container {
        height: 240px;
    }

    .stat-card h3 {
        font-size: 2.5rem;
    }

    /* Sections */
    .section {
        padding: 80px 0;
    }

    .section-title {
        font-size: 3rem;
    }

    /* Clubs */
    .clubs-grid {
        gap: 25px;
    }

    .club-card {
        padding: 40px 25px 30px;
    }

    .club-logo {
        width: 90px;
        height: 90px;
    }

    .club-name {
        font-size: 1.3rem;
    }

    /* Podium */
    .podium-item {
        width: 180px;
    }

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

    /* Venue */
    .venue-section {
        padding: 100px 5%;
    }

    .venue-title {
        font-size: 3rem;
    }
}


/* ==============================================
   ACCESSIBILITY & TOUCH IMPROVEMENTS
   ============================================== */

/* Touch-friendly tap targets */
button,
a,
input,
select,
.program-tab,
.orbital-item,
.club-card,
.academy-card,
.sponsor-logo-card,
.gallery-item {
    min-height: var(--tap-target-min);
}

/* Focus states for keyboard navigation */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .btn-primary,
    .nav a.cta {
        border: 2px solid currentColor;
    }
}


/* ==============================================
   DEVENIR PARTENAIRE SECTION - MOBILE FIX
   ============================================== */

/* Mobile base (0-479px) */
.devenir-partenaire-section {
    padding: 25px 15px !important;
    margin-top: 40px !important;
}

.devenir-partenaire-section .sponsor-category-title {
    font-size: 1.1rem !important;
    text-align: center;
}

.devenir-partenaire-section .sponsor-category-desc {
    font-size: 0.9rem !important;
    padding: 0 5px;
}

/* Stats boxes - override inline styles */
.devenir-partenaire-section > div[style*="display: flex"][style*="flex-wrap"] {
    gap: 12px !important;
    margin-bottom: 25px !important;
}

.devenir-partenaire-section > div[style*="display: flex"] > div[style*="min-width"] {
    min-width: calc(50% - 10px) !important;
    padding: 15px 12px !important;
    flex: 1 1 calc(50% - 10px) !important;
}

.devenir-partenaire-section > div[style*="display: flex"] > div[style*="min-width"] > div:first-child {
    font-size: 1.5rem !important;
}

.devenir-partenaire-section > div[style*="display: flex"] > div[style*="min-width"] > div:last-child {
    font-size: 0.75rem !important;
}

/* Avantages grid - override inline styles */
.devenir-partenaire-section > div[style*="display: grid"] {
    grid-template-columns: 1fr !important;
    gap: 15px !important;
    margin-bottom: 25px !important;
}

.devenir-partenaire-section > div[style*="display: grid"] > div[style*="border-left"] {
    padding: 15px !important;
}

.devenir-partenaire-section > div[style*="display: grid"] > div[style*="border-left"] h5 {
    font-size: 0.95rem !important;
}

.devenir-partenaire-section > div[style*="display: grid"] > div[style*="border-left"] p {
    font-size: 0.85rem !important;
}

/* CTA Buttons - override inline styles */
.devenir-partenaire-section > div[style*="display: flex"]:last-child {
    flex-direction: column !important;
    gap: 12px !important;
}

.devenir-partenaire-section .cta-partenaire-btn,
.devenir-partenaire-section .cta-membre-btn {
    width: 100% !important;
    justify-content: center !important;
    padding: 14px 20px !important;
    font-size: 1rem !important;
}

/* ==============================================
   FOOTER GRID - MOBILE FIX
   ============================================== */

.footer-content[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 25px !important;
    text-align: center !important;
}

/* ==============================================
   CONTACT WRAPPER - MOBILE FIX
   ============================================== */

.contact-wrapper {
    grid-template-columns: 1fr !important;
    gap: 25px !important;
}

.contact-form-card {
    padding: 25px 20px !important;
}

.contact-form-card .form-row {
    grid-template-columns: 1fr !important;
}

.contact-info-side {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 15px !important;
}

.contact-info-side .contact-card {
    min-width: unset !important;
}

/* ==============================================
   CYBER CARDS / FUTURISTIC GRID - MOBILE FIX
   ============================================== */

.futuristic-grid {
    margin: 30px auto 0 !important;
    padding: 0 10px;
}

.cyber-tabs {
    gap: 6px !important;
    padding: 0 5px;
}

.cyber-tab {
    padding: 10px 12px !important;
    font-size: 0.75rem !important;
}

.cyber-tab span:last-child {
    display: none;
}

.cyber-cards-container {
    min-height: 350px !important;
}

.cyber-card-inner {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
    padding: 20px 15px !important;
}

.cyber-card-inner.reverse {
    direction: ltr !important;
}

.cyber-card-visual {
    order: -1 !important;
}

.cyber-card-header h3 {
    font-size: 1.3rem !important;
    letter-spacing: 2px !important;
}

.cyber-icon {
    width: 45px !important;
    height: 45px !important;
}

.cyber-card-text p {
    font-size: 0.85rem !important;
    line-height: 1.7 !important;
}

.cyber-data-bar {
    flex-wrap: wrap !important;
    gap: 12px !important;
}

.cyber-stats-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
}

.cyber-stat {
    padding: 15px !important;
}

.cyber-stat .stat-value {
    font-size: 2rem !important;
}

.cyber-stat .stat-label {
    font-size: 0.65rem !important;
}

.cyber-values-display {
    width: 200px !important;
    height: 200px !important;
    margin: 0 auto !important;
}

.orbit-item {
    font-size: 0.7rem !important;
    padding: 6px 10px !important;
}

.mystery-hologram {
    width: 180px !important;
    height: 180px !important;
}

.orga-hexagons {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
}

.hex-item {
    padding: 15px !important;
}

.hex-item span {
    font-size: 0.75rem !important;
}

.progress-line {
    width: 150px !important;
}

/* ==============================================
   MEGA MENU INLINE MIN-WIDTH OVERRIDE
   ============================================== */

.mega-menu[style*="min-width"],
.mega-menu-equipes[style*="min-width"],
.mega-menu-programme[style*="min-width"] {
    min-width: unset !important;
    width: 95vw !important;
    max-width: 95vw !important;
}

/* ==============================================
   QUALI CLUBS SECTION (24 CLUBS) - MOBILE FIX
   ============================================== */

.quali-clubs-section {
    padding: 30px 0 !important;
}

.quali-clubs-title {
    font-size: 1.3rem !important;
    flex-wrap: wrap;
    text-align: center;
}

.quali-clubs-intro {
    font-size: 0.85rem !important;
    padding: 0 10px;
}

/* Force single column on mobile */
.quali-groups-wrapper {
    grid-template-columns: 1fr !important;
    gap: 15px !important;
    padding: 0 5px;
}

.quali-groupe-card {
    margin-bottom: 0;
}

.quali-groupe-header {
    padding: 12px 14px !important;
}

.groupe-letter {
    font-size: 1.1rem !important;
}

.groupe-day {
    font-size: 0.75rem !important;
    padding: 3px 8px !important;
}

.quali-groupe-teams {
    padding: 12px !important;
    gap: 8px !important;
}

.quali-team-item {
    padding: 8px 10px !important;
    gap: 10px !important;
}

.quali-team-logo {
    width: 30px !important;
    height: 30px !important;
}

.quali-team-name {
    font-size: 0.85rem !important;
}

/* ==============================================
   CLASSEMENTS SECTION - MOBILE FIX
   ============================================== */

.quali-classements-section {
    padding: 30px 0 !important;
    margin: 30px 0 !important;
}

.quali-classements-title {
    font-size: 1.3rem !important;
    flex-wrap: wrap;
}

.quali-classements-intro {
    font-size: 0.85rem !important;
    padding: 0 10px;
}

/* Force single column */
.classements-wrapper {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
    padding: 0 5px;
}

.classement-groupe-card {
    overflow-x: auto;
}

.classement-groupe-header {
    padding: 10px 14px !important;
}

.classement-groupe-letter {
    font-size: 1.1rem !important;
}

.classement-groupe-day {
    font-size: 0.7rem !important;
}

/* Table mobile adjustments */
.classement-table {
    font-size: 0.7rem !important;
    min-width: 100%;
}

.classement-table th,
.classement-table td {
    padding: 8px 3px !important;
}

.classement-table th {
    font-size: 0.65rem !important;
}

.classement-team-logo {
    width: 22px !important;
    height: 22px !important;
}

.classement-team-name {
    max-width: 70px !important;
    font-size: 0.7rem !important;
}

/* Hide less important columns on very small screens */
.classement-table .col-mj,
.classement-table .col-v,
.classement-table .col-n,
.classement-table .col-d {
    display: none;
}

/* ==============================================
   PODIUMS SECTION - MOBILE FIX
   ============================================== */

.quali-podiums-section {
    padding: 30px 0 !important;
    margin: 30px 0 !important;
}

.quali-podiums-title {
    font-size: 1.3rem !important;
    flex-wrap: wrap;
}

.quali-day-title {
    font-size: 1rem !important;
    padding: 0 10px;
    margin: 20px 0 15px !important;
}

/* Podium mobile: colonne verticale, gold (1er) en premier */
.quali-podium {
    flex-direction: column !important;
    align-items: center !important;
    gap: 15px !important;
}

.podium-item {
    width: 100% !important;
    max-width: 280px !important;
    padding: 20px 15px !important;
}

.podium-item.gold {
    order: -1 !important;
    transform: scale(1) !important;
}

.podium-item.silver {
    order: 0 !important;
}

.podium-item.bronze {
    order: 1 !important;
}

.podium-rank {
    width: 35px !important;
    height: 35px !important;
    font-size: 1rem !important;
}

.podium-logo {
    width: 50px !important;
    height: 50px !important;
}

.podium-name {
    font-size: 0.85rem !important;
}

.podium-badge {
    font-size: 0.7rem !important;
    padding: 4px 10px !important;
}

/* ==============================================
   FILTERS BAR - MOBILE FIX
   ============================================== */

.quali-filters-bar {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 12px !important;
    padding: 15px !important;
}

.quali-filter-group {
    width: 100% !important;
}

.quali-filter-select {
    width: 100% !important;
    min-width: unset !important;
    padding: 12px 35px 12px 12px !important;
}

.quali-filter-reset {
    width: 100% !important;
    justify-content: center !important;
    padding: 12px !important;
}

/* ==============================================
   ALL MATCHES GRID - MOBILE FIX
   ============================================== */

.quali-all-matches-section {
    padding: 30px 0 !important;
    margin: 30px 0 !important;
}

.quali-all-matches-title {
    font-size: 1.3rem !important;
    flex-wrap: wrap;
}

.quali-all-matches-intro {
    font-size: 0.85rem !important;
    padding: 0 10px;
}

/* Force single column on mobile - override minmax(340px) */
.quali-all-matches-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    max-height: none !important;
    padding: 5px !important;
}

/* Match Card Mobile */
.quali-match-card {
    border-radius: 10px !important;
}

.quali-match-header {
    padding: 8px 12px !important;
    gap: 6px !important;
}

.quali-match-time {
    font-size: 0.85rem !important;
}

.quali-match-day {
    font-size: 0.7rem !important;
    padding: 2px 6px !important;
}

.quali-match-groupe {
    font-size: 0.65rem !important;
    padding: 2px 6px !important;
}

.quali-match-phase {
    font-size: 0.6rem !important;
    padding: 2px 8px !important;
}

.quali-match-content {
    padding: 12px !important;
    gap: 8px !important;
}

.quali-match-team {
    gap: 6px !important;
}

.quali-match-logo {
    width: 40px !important;
    height: 40px !important;
}

.quali-match-name {
    font-size: 0.8rem !important;
    max-width: 90px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.quali-match-score {
    font-size: 1.4rem !important;
    min-width: 70px !important;
}

.quali-match-score-home,
.quali-match-score-away {
    font-size: 1.4rem !important;
}

.quali-match-vs {
    font-size: 0.7rem !important;
}

.quali-match-extra {
    font-size: 0.6rem !important;
}

.quali-match-footer {
    padding: 8px 12px !important;
    font-size: 0.7rem !important;
}

/* ==============================================
   GALLERY GRID - MOBILE FIX (Horizontal Scroll)
   ============================================== */

.quali-gallery {
    margin: 30px 0 !important;
    overflow: hidden;
}

.quali-gallery-title {
    font-size: 1.1rem !important;
    flex-wrap: wrap;
    text-align: center;
    padding: 0 15px;
}

.quali-gallery-title::before,
.quali-gallery-title::after {
    width: 25px !important;
}

/* Horizontal scroll gallery on mobile */
.quali-gallery-grid,
.quali-gallery-grid.masonry-gallery {
    display: flex !important;
    flex-direction: row !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    scroll-snap-type: x mandatory !important;
    -webkit-overflow-scrolling: touch;
    gap: 12px !important;
    padding: 10px 15px 20px !important;
    margin: 0 !important;
    max-width: none !important;
    grid-template-columns: unset !important;
    grid-auto-rows: unset !important;
}

/* Hide scrollbar but keep functionality */
.quali-gallery-grid::-webkit-scrollbar {
    height: 6px;
}

.quali-gallery-grid::-webkit-scrollbar-track {
    background: var(--surface, #f0f0f0);
    border-radius: 3px;
}

.quali-gallery-grid::-webkit-scrollbar-thumb {
    background: var(--accent, #D50000);
    border-radius: 3px;
}

/* Gallery items - fixed width cards for horizontal scroll */
.gallery-item,
.gallery-item.landscape,
.gallery-item.portrait {
    flex: 0 0 auto !important;
    width: 280px !important;
    height: 200px !important;
    scroll-snap-align: start;
    grid-row: unset !important;
    border-radius: 12px !important;
    opacity: 1 !important;
    transform: none !important;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    overflow: hidden;
    position: relative;
}

/* Skeleton loading animation for gallery items */
.gallery-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.08) 50%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: skeletonLoading 1.5s infinite;
    z-index: 1;
    pointer-events: none;
}

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

/* Hide skeleton when image is loaded */
.gallery-item.loaded::before {
    display: none !important;
}

.gallery-item.visible {
    opacity: 1 !important;
    transform: none !important;
}

.gallery-item img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: opacity 0.3s ease;
    position: relative;
    z-index: 2;
}

/* Loading state - show placeholder until image loads */
.gallery-item img[loading="lazy"] {
    background: transparent;
}

.gallery-item img:not([src]) {
    opacity: 0;
}

/* ==============================================
   PHOTO MODAL LOADING STATE - MOBILE
   ============================================== */

.photo-modal.loading .photo-modal-image {
    opacity: 0.3;
}

.photo-modal.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: #D50000;
    border-radius: 50%;
    animation: modalSpinner 0.8s linear infinite;
    z-index: 100;
}

@keyframes modalSpinner {
    to { transform: rotate(360deg); }
}

.photo-modal-image {
    transition: opacity 0.3s ease;
    max-width: 95vw !important;
    max-height: 85vh !important;
}

/* Scroll indicator hint */
.quali-gallery::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--bg-primary, #fff));
    pointer-events: none;
    opacity: 0.8;
}

.quali-gallery {
    position: relative;
}

/* ==============================================
   TABLET BREAKPOINT (768px+)
   ============================================== */
@media (min-width: 768px) {
    /* Quali clubs - 2 columns on tablet */
    .quali-groups-wrapper {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px !important;
    }

    .quali-groupe-header {
        padding: 14px 16px !important;
    }

    .groupe-letter {
        font-size: 1.2rem !important;
    }

    .quali-team-logo {
        width: 34px !important;
        height: 34px !important;
    }

    .quali-team-name {
        font-size: 0.9rem !important;
    }

    /* Classements - still 1 column, more space */
    .classements-wrapper {
        gap: 25px !important;
    }

    .classement-table {
        font-size: 0.8rem !important;
    }

    .classement-team-name {
        max-width: 100px !important;
        font-size: 0.8rem !important;
    }

    /* Show some hidden columns back */
    .classement-table .col-mj {
        display: table-cell;
    }

    /* Podiums - row layout avec effet podium: silver | GOLD | bronze */
    .quali-podium {
        flex-direction: row !important;
        align-items: flex-start !important;
    }

    .podium-item {
        width: 150px !important;
        max-width: none !important;
    }

    .podium-item.gold {
        transform: scale(1.05) !important;
        margin-top: 0 !important;
        order: 0 !important;
    }

    .podium-item.silver {
        margin-top: 40px !important;
        order: -1 !important;
    }

    .podium-item.bronze {
        margin-top: 40px !important;
        order: 1 !important;
    }

    /* Filters - 2 per row */
    .quali-filters-bar {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        align-items: flex-end !important;
    }

    .quali-filter-group {
        width: auto !important;
        flex: 1 1 calc(33% - 15px);
        min-width: 140px;
    }

    .quali-filter-select {
        width: auto !important;
        min-width: 130px !important;
    }

    .quali-filter-reset {
        width: auto !important;
    }

    /* Gallery - restore grid on tablet */
    .quali-gallery::after {
        display: none;
    }

    .quali-gallery-grid,
    .quali-gallery-grid.masonry-gallery {
        display: grid !important;
        grid-template-columns: repeat(3, 1fr) !important;
        grid-auto-rows: 10px !important;
        overflow-x: visible !important;
        overflow-y: visible !important;
        scroll-snap-type: none !important;
        padding: 5px !important;
        max-width: 1000px !important;
        margin: 0 auto !important;
        gap: 12px !important;
    }

    .gallery-item,
    .gallery-item.landscape,
    .gallery-item.portrait {
        width: auto !important;
        height: auto !important;
        flex: unset !important;
    }

    .gallery-item.landscape {
        grid-row: span 15 !important;
    }

    .gallery-item.portrait {
        grid-row: span 24 !important;
    }

    /* Matches grid - 2 columns on tablet */
    .quali-all-matches-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px !important;
    }

    .quali-match-logo {
        width: 45px !important;
        height: 45px !important;
    }

    .quali-match-name {
        font-size: 0.85rem !important;
        max-width: 100px;
    }

    .quali-match-score {
        font-size: 1.5rem !important;
    }

    .devenir-partenaire-section {
        padding: 35px 30px !important;
    }

    .devenir-partenaire-section > div[style*="display: flex"] > div[style*="min-width"] {
        min-width: 120px !important;
        flex: 0 1 auto !important;
    }

    .devenir-partenaire-section > div[style*="display: grid"] {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .devenir-partenaire-section > div[style*="display: flex"]:last-child {
        flex-direction: row !important;
    }

    .devenir-partenaire-section .cta-partenaire-btn,
    .devenir-partenaire-section .cta-membre-btn {
        width: auto !important;
    }

    .footer-content[style*="grid-template-columns"] {
        grid-template-columns: repeat(2, 1fr) !important;
        text-align: left !important;
    }

    .contact-wrapper {
        grid-template-columns: 1fr !important;
    }

    .contact-info-side {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .cyber-card-inner {
        padding: 25px !important;
    }

    .cyber-values-display {
        width: 240px !important;
        height: 240px !important;
    }
}

/* ==============================================
   DESKTOP BREAKPOINT (1024px+)
   ============================================== */
@media (min-width: 1024px) {
    /* Quali clubs - 4 columns on desktop */
    .quali-groups-wrapper {
        grid-template-columns: repeat(4, 1fr) !important;
    }

    .quali-groupe-header {
        padding: 14px 16px !important;
    }

    .groupe-letter {
        font-size: 1.3rem !important;
    }

    .quali-team-logo {
        width: 36px !important;
        height: 36px !important;
    }

    /* Classements - 2 columns */
    .classements-wrapper {
        grid-template-columns: repeat(2, 1fr) !important;
    }

    .classement-table {
        font-size: 0.85rem !important;
    }

    .classement-team-name {
        max-width: 140px !important;
    }

    /* Show all columns */
    .classement-table .col-mj,
    .classement-table .col-v,
    .classement-table .col-n,
    .classement-table .col-d {
        display: table-cell;
    }

    /* Podiums full size - style olympique */
    .podium-item {
        width: 170px !important;
        padding: 25px !important;
    }

    .podium-item.gold {
        transform: scale(1.08) !important;
        margin-top: 0 !important;
        order: 0 !important;
    }

    .podium-item.silver {
        margin-top: 40px !important;
        order: -1 !important;
    }

    .podium-item.bronze {
        margin-top: 40px !important;
        order: 1 !important;
    }

    .podium-logo {
        width: 55px !important;
        height: 55px !important;
    }

    /* Filters all in row */
    .quali-filter-group {
        flex: 0 1 auto;
    }

    /* Gallery 4 columns - full masonry on desktop */
    .quali-gallery-grid,
    .quali-gallery-grid.masonry-gallery {
        grid-template-columns: repeat(4, 1fr) !important;
        grid-auto-rows: 10px !important;
    }

    .gallery-item.landscape {
        grid-row: span 18 !important;
    }

    .gallery-item.portrait {
        grid-row: span 28 !important;
    }

    /* Matches grid - 3 columns on desktop (original behavior) */
    .quali-all-matches-grid {
        grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)) !important;
        max-height: 800px !important;
    }

    .quali-match-logo {
        width: 50px !important;
        height: 50px !important;
    }

    .quali-match-name {
        font-size: 0.9rem !important;
        max-width: none;
    }

    .quali-match-header {
        padding: 10px 14px !important;
    }

    .quali-match-content {
        padding: 16px !important;
    }

    .devenir-partenaire-section {
        padding: 40px !important;
    }

    .devenir-partenaire-section > div[style*="display: flex"] > div[style*="min-width"] {
        min-width: 140px !important;
    }

    .devenir-partenaire-section > div[style*="display: flex"] > div[style*="min-width"] > div:first-child {
        font-size: 2rem !important;
    }

    .devenir-partenaire-section > div[style*="display: grid"] {
        grid-template-columns: repeat(3, 1fr) !important;
    }

    .footer-content[style*="grid-template-columns"] {
        grid-template-columns: 1.5fr 1fr 1fr 1fr 1fr !important;
    }

    .contact-wrapper {
        grid-template-columns: 1.5fr 1fr !important;
    }

    .contact-info-side {
        grid-template-columns: 1fr !important;
    }

    .cyber-card-inner {
        grid-template-columns: 1fr 1fr !important;
        gap: 40px !important;
        padding: 40px !important;
    }

    .cyber-card-inner.reverse {
        direction: rtl !important;
    }

    .cyber-card-inner.reverse > * {
        direction: ltr !important;
    }

    .cyber-card-visual {
        order: unset !important;
    }

    .cyber-values-display {
        width: 280px !important;
        height: 280px !important;
    }
}

/* ==============================================
   PRINT STYLES
   ============================================== */
@media print {
    .header,
    .mobile-menu-toggle,
    .hero-video-container,
    .hero-tv-card,
    .theme-toggle,
    .modal-overlay,
    .photo-modal,
    .legal-modal-overlay {
        display: none !important;
    }

    .section {
        page-break-inside: avoid;
    }

    body {
        font-size: 12pt;
        color: #000;
        background: #fff;
    }
}
