/* =========================================
   1. GRUNDLÆGGENDE STYLING
   ========================================= */
*, *::before, *::after {
    box-sizing: border-box; /* Sikrer at ingen elementer skubber sig uden for skærmen */
}

   html, body {
    /* VIGTIGT MOBIL-FIX: Klipper alt af, der prøver at stikke uden for skærmen i højre side */
    max-width: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    line-height: 1.6;
    color: #333;
    scroll-behavior: smooth;
    
    /* Her er den nye baggrund med farveovergang */
    background: linear-gradient(to bottom, #ffffff 0%, #ff0000 100%);
    
    /* Låser baggrunden så overgangen ikke gentager sig, når man scroller ned */
    background-attachment: fixed; 
}

/* =========================================
   2. NAVIGATION & BURGERMENU
   ========================================= */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 5%;
    background: #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.logo { 
    font-size: 1.5rem; 
    font-weight: bold; 
    color: #2c3e50; 
}

.logo img {
    height: 50px;
    width: auto;
    display: block;
    padding: 5px 0;
}

.nav-links { 
    display: flex; 
    list-style: none; 
    gap: 20px; 
    align-items: center; 
}

.nav-links a { 
    text-decoration: none; 
    color: #333; 
    font-weight: 500; 
    transition: color 0.3s;
}

.nav-links a:hover, 
.nav-links a.active {
    color: #27ae60;
}

/* Styling af burger-ikonet */
.burger {
    display: none;
    cursor: pointer;
    z-index: 1001;
}

.burger span {
    display: block;
    width: 25px;
    height: 3px;
    background: #333;
    margin: 5px;
    transition: all 0.3s ease;
}

/* =========================================
   3. KNAPPER
   ========================================= */
/* Den grønne tilmeldingsknap (Menu m.m.) */
.btn-tilmeld {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white !important;
    padding: 12px 25px;
    border: none;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    box-shadow: 0 4px 15px rgba(46, 204, 113, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.btn-tilmeld:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(46, 204, 113, 0.4);
    filter: brightness(1.1);
}

/* Knappen i aktivitetskortene */
.card-btn {
    background: #f8f9fa;
    color: #2c3e50;
    border: 2px solid #2c3e50;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: bold;
    text-decoration: none;
    transition: 0.2s;
    display: inline-block;
}

.card-btn:hover {
    background: #2c3e50;
    color: white;
}

/* Knap over videobaggrund */
.cta-button {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: white;
    padding: 15px 35px;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: bold;
    text-decoration: none;
    transition: all 0.4s ease;
    display: inline-block;
    margin-top: 20px;
}

.cta-button:hover {
    background: white;
    color: #2c3e50;
    border-color: white;
}

/* Små knapper i tabeller */
.btn-small {
    background: #27ae60;
    color: white;
    padding: 5px 15px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-block;
    transition: background 0.3s;
}

.btn-small:hover {
    background: #219653;
}

/* =========================================
   4. HERO & VIDEO BAGGARUND (Forside)
   ========================================= */
.hero {
    position: relative;
    height: 70vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.video-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    overflow: hidden;
}

.video-background video {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
}

.hero::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 0 20px;
}

/* =========================================
   5. SUB-HERO (Undersider Baggrunde)
   ========================================= */
.sub-hero {
    height: 40vh;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-align: center;
    background-size: cover;
    background-repeat: no-repeat;
    position: relative;
}

.gymnastik-bg {
    background-position: center 20%;
    background-image: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)),
                      url('https://firebasestorage.googleapis.com/v0/b/oerslev-bjerge-if.firebasestorage.app/o/433523151_10232943614353042_8149366693731871353_n.jpg?alt=media&token=4b970ef0-eada-4c3b-810e-b7045f47cdfe');
}

.badminton-bg {
    background-position: center;
    background-image: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), 
                      url('https://images.unsplash.com/photo-1626225967045-9410f84033bd?auto=format&fit=crop&w=1200');
}

.fodbold-bg {
    background-position: center 40%;
    background-image: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), 
                      url('https://images.unsplash.com/photo-1574629810360-7efbbe195018?auto=format&fit=crop&w=1200');
}

.fitness-bg {
    background-position: center;
    background-image: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), 
                      url('https://images.unsplash.com/photo-1540497077202-7c8a3999166f?auto=format&fit=crop&w=1200');
}

.hoved-bg {
    background-position: center;
    background-image: linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.6)), 
                      url('https://images.unsplash.com/photo-1511632765486-a01980e01a18?auto=format&fit=crop&w=1200');
}

/* =========================================
   6. GRID SYSTEM & AKTIVITETSKORT
   ========================================= */
.section { 
    padding: 4rem 5%; 
    text-align: center; 
}

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

.intro-text {
    margin-bottom: 2rem;
    color: #555;
    font-size: 1.1rem;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 30px;
}

.card {
    background: #f9f9f9;
    padding: 2rem;
    border-radius: 10px;
    transition: transform 0.3s;
    border-bottom: 4px solid #2c3e50;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.card:hover { 
    transform: translateY(-10px); 
}

.card-img { 
    font-size: 3rem; 
    margin-bottom: 10px; 
}

.card h3 {
    margin: 10px 0;
}

.card p {
    flex-grow: 1;
    color: #666;
}

/* =========================================
   7. TABELLER (Holdoversigt)
   ========================================= */
.team-table-wrapper {
    overflow-x: auto;
    margin-top: 2rem;
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
}

.team-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

/* Omfatter både th og td i head, så f.eks. "Aldersgruppe" bliver blå */
.team-table th, .team-table thead td {
    background-color: #2c3e50;
    color: white;
    font-weight: bold;
    padding: 15px;
    text-align: left;
}

.team-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
    color: #444;
}

.team-table tr:last-child td {
    border-bottom: none;
}

.team-table tbody tr:hover {
    background-color: #f8f9fa;
}

/* =========================================
   8. INFO SEKTION & KONTAKT
   ========================================= */
.bg-light { 
    background: #f4f7f6; 
}

.info-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    max-width: 1100px;
    margin: 0 auto;
    text-align: left;
}

.info-text ul {
    list-style-type: square;
    padding-left: 20px;
}

.info-text li {
    margin-bottom: 10px;
    color: #555;
}

.contact-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    border-left: 5px solid #e67e22;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.contact-card h3 {
    margin-top: 0;
    color: #2c3e50;
}

/* =========================================
   9. HOVEDFORENING (Søgning & Instruktører)
   ========================================= */
.search-section {
    padding: 1.5rem 5% 0;
    max-width: 800px;
    margin: 0 auto;
}

#instructorSearch {
    width: 100%;
    padding: 15px 20px;
    font-size: 16px;
    border: 2px solid #eee;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    -webkit-appearance: none;
    outline: none;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

#instructorSearch:focus {
    border-color: #2c3e50;
}

.dept-title {
    text-align: left;
    margin: 3rem 0 1.5rem;
    padding-bottom: 10px;
    border-bottom: 3px solid #2c3e50;
    color: #2c3e50;
}

.instructor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    padding: 10px 0;
}

.instructor-card {
    background: white;
    padding: 15px 10px;
    border-radius: 15px;
    text-align: center;
    border: 1px solid #f0f0f0;
    box-shadow: 0 4px 8px rgba(0,0,0,0.05);
    transition: transform 0.2s, opacity 0.3s ease-in-out;
}

.instructor-card:hover {
    transform: translateY(-5px);
}

.inst-img {
    font-size: 3rem;
    background: #f8f9fa;
    width: 80px;
    height: 80px;
    line-height: 80px;
    border-radius: 50%;
    margin: 0 auto 15px;
}

.instructor-card h4 { 
    margin: 10px 0 5px; 
    color: #2c3e50; 
}

.instructor-card p { 
    font-size: 0.9rem; 
    color: #7f8c8d; 
    margin: 0; 
}

/* =========================================
   10. MOBIL TILPASNING (Media Queries)
   ========================================= */

/* Tablets og mindre skærme */
@media (max-width: 768px) {
    .burger { 
        display: block; 
    }

    /* Selve baggrunds-menuen (Det store stykke flydende glas) */
    .nav-links {
        position: fixed;
        right: 0; 
        top: 60px; 
        height: calc(100vh - 60px);
        background: rgba(255, 255, 255, 0.25); /* Gennemført gennemsigtighed */
        backdrop-filter: blur(20px); 
        -webkit-backdrop-filter: blur(20px); 
        border-top: 1px solid rgba(255, 255, 255, 0.4); 
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08); 
        
        display: flex;
        flex-direction: column;
        align-items: center;
        width: 100%;
        padding-top: 40px;
        z-index: 999;
        
        opacity: 0;
        visibility: hidden;
        transition: opacity 0.4s ease, visibility 0.4s ease;
    }

    .nav-links.nav-active {
        opacity: 1;
        visibility: visible;
    }

    /* Sikrer at menupunkterne strækker sig flot ud og centrerer knapperne */
    .nav-links li {
        margin: 10px 0;
        width: 100%;
        display: flex;
        justify-content: center;
    }

    /* 💎 DE NYE OVALE LIQUID GLASS KNAPPER 💎 */
    .nav-links a {
        font-size: 1.15rem;
        font-weight: 600;
        color: #2c3e50;
        text-decoration: none;
        text-align: center;
        
        display: block;
        width: 75%; /* Gør alle knapperne præcis lige brede */
        max-width: 320px; /* Forhindrer knapperne i at blive for aflange på tablets */
        padding: 14px 25px;
        border-radius: 50px; /* 100% oval runding i enderne */
        
        /* Glas-effekt på selve knappen */
        background: rgba(255, 255, 255, 0.4); 
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        border: 1px solid rgba(255, 255, 255, 0.6); /* Lysreflekterende kant */
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.02); /* Ultrablød dybde */
        
        /* Gør overgangen silkeblød når man trykker */
        transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    }

    /* Smuk grøn klub-glød når en knap trykkes ned eller er aktiv */
    .nav-links a:hover,
    .nav-links a.active {
        background: rgba(39, 174, 96, 0.25); /* Svagt grønligt skær i glasset */
        border-color: rgba(39, 174, 96, 0.6);
        color: #27ae60;
        transform: translateY(-2px); /* Løfter knappen en lille smule visuelt */
        box-shadow: 0 6px 20px rgba(39, 174, 96, 0.15);
    }

    /* Animering af burger til kryds */
    .burger.toggle span:nth-child(1) {
        transform: rotate(-45deg) translate(-5px, 6px);
    }
    .burger.toggle span:nth-child(2) {
        opacity: 0;
    }
    .burger.toggle span:nth-child(3) {
        transform: rotate(45deg) translate(-5px, -6px);
    }

    /* Info sektion stables */
    .info-grid {
        grid-template-columns: 1fr;
    }
}


/* =========================================
   11. SPONSOR MARQUEE (Dynamisk rullende/statisk)
   ========================================= */
.sponsor-section {
    padding: 3rem 0;
    background-color: #f8f9fa;
    overflow: hidden;
}

.sponsor-slider {
    background: white;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
    padding: 25px 0;
    overflow: hidden;
    position: relative;
    width: 100%;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
    /* Sikrer at logoerne er centreret pænt, hvis der er for få til at rulle */
    display: flex;
    justify-content: center;
}

.sponsor-track {
    display: flex;
    width: max-content;
}

/* DENNE KLASSE TILFØJES KUN AF JAVASCRIPT, HVIS DER ER MANGE SPONSORER */
.sponsor-track.scrolling {
    animation: scrollSponsors 40s linear infinite;
    /* Hvis den ruller, vil vi ikke have flex-center til at forstyrre starten af loopet */
    justify-content: flex-start;
}

.sponsor-track.scrolling:hover {
    animation-play-state: paused;
}

.sponsor-item {
    padding: 0 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.sponsor-item img {
    height: 55px;
    width: auto;
    filter: grayscale(100%);
    opacity: 0.6;
    transition: all 0.3s ease;
}

.sponsor-item img:hover {
    filter: grayscale(0%);
    opacity: 1;
    transform: scale(1.05);
}

@keyframes scrollSponsors {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* =========================================
   12. NYHEDSARKIV (FLOTTE FIRKANTEDE KORT)
   ========================================= */
.news-grid {
    display: grid;
    /* auto-fill sikrer at kasserne forbliver pæne og små (240px), 
       så der nemt kan være 4-5 ved siden af hinanden på en stor skærm */
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 25px;
    padding: 20px 0;
}

.news-card {
    position: relative;
    background-color: #fff;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.04);
    cursor: pointer;
    /* Gør kortet fuldstændig kvadratisk (1:1) */
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: flex-end;
    transition: transform 0.3s cubic-bezier(0.25, 0.8, 0.25, 1), 
                box-shadow 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Elegant svæve-effekt når musen holdes over */
.news-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 25px rgba(0, 0, 0, 0.12);
}

.news-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 1;
    transition: transform 0.5s ease;
}

/* Zoomer en lille smule ind på billedet ved hover for ekstra liv */
.news-card:hover .news-img {
    transform: scale(1.04);
}

/* Den mørke toning i bunden af firkanten, der sikrer at teksten altid er nem at læse */
.news-overlay-content {
    position: relative;
    z-index: 2;
    background: linear-gradient(to top, 
                rgba(0, 0, 0, 0.85) 0%, 
                rgba(0, 0, 0, 0.4) 60%, 
                rgba(0, 0, 0, 0) 100%);
    width: 100%;
    padding: 35px 20px 20px 20px;
    color: white;
    text-align: left;
    box-sizing: border-box;
}

.news-overlay-date {
    font-size: 0.8rem;
    color: #f1c40f; /* Flot guld/orange sports-farve til datoen */
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 6px;
}

.news-overlay-title {
    font-size: 1.15rem;
    margin: 0;
    line-height: 1.3;
    font-weight: 600;
    /* Sikrer at ekstremt lange titler ikke ødelægger firkanten ved at skjule tekst efter 2 linjer */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


/* =========================================
   13. NYHEDS POPUP (ELEGANT MODAL VINDUE)
   ========================================= */
.news-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(44, 62, 80, 0.7); /* Mørkeblå semi-gennemsigtig nuance */
    backdrop-filter: blur(5px); /* Slører baggrunden super flot og moderne */
    z-index: 2000;
    display: none;
    justify-content: center;
    align-items: center;
    padding: 20px;
    box-sizing: border-box;
}

.news-modal-content {
    background: #ffffff;
    border-radius: 16px;
    max-width: 680px;
    width: 100%;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    animation: modalSlideUp 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Lukke-knappen i øverste højre hjørne */
.close-modal-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: white;
    color: #2c3e50;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    text-align: center;
    line-height: 34px;
    font-size: 1.4rem;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
    z-index: 10;
    transition: all 0.2s ease;
    border: 1px solid #eee;
}

.close-modal-btn:hover {
    background: #e74c3c;
    color: white;
    border-color: #e74c3c;
}

.modal-img {
    width: 100%;
    height: 320px;
    object-fit: cover;
    display: block;
}

.modal-text-box {
    padding: 35px;
    text-align: left;
}

.modal-text-box h2 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #2c3e50;
    font-size: 1.75rem;
    line-height: 1.3;
}

/* Blød glide-op animation når en nyhed åbnes */
@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

/* =========================================
   14. SUPER-SYNLIGT NYHEDS BADGE (PULSERENDE GLØD)
   ========================================= */
.badge-nyhed {
    background: #ff0000; /* Helt krads rød */
    color: white;
    padding: 4px 12px;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 800; /* Ekstra fed skrift */
    margin-left: 12px;
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 1px;
    vertical-align: middle;
    /* Kører en uendelig animation på 0,8 sekunder, der pumper og lyser */
    animation: superGlow 0.8s infinite alternate ease-in-out;
}

@keyframes superGlow {
    0% {
        transform: scale(1);
        background: #cc0000;
        box-shadow: 0 0 4px #ff0000;
    }
    100% {
        transform: scale(1.08); /* Svinger en lille smule i størrelsen */
        background: #ff0000;
        /* Laver en kraftig pulserende rød neon-glød rundt om teksten */
        box-shadow: 0 0 12px #ff0000, 0 0 20px #ff0000;
    }
}

/* =========================================
   15. GLOBAL SØGEFUNKTION
   ========================================= */
.search-trigger-btn {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px 10px;
    transition: transform 0.2s;
    margin-right: 15px;
}

.search-trigger-btn:hover {
    transform: scale(1.1);
}

/* Kasserne til søgeresultaterne */
.search-result-item {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #27ae60;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.search-result-item:hover {
    background: #f1f2f6;
    transform: translateX(5px);
}

.search-type-badge {
    font-size: 0.75rem;
    padding: 3px 8px;
    border-radius: 20px;
    font-weight: bold;
    color: white;
    text-transform: uppercase;
}

/* =========================================
   SIDEFOD (FOOTER)
   ========================================= */
.site-footer {
    background-color: #2c3e50; /* Mørkeblå/grå farve, der passer til temaet */
    color: #ecf0f1;
    padding: 50px 20px 20px;
    margin-top: 60px;
    font-family: inherit;
    border-top: 4px solid #27ae60; /* En grøn top-linje for at bryde designet pænt */
}

.footer-container {
    max-width: 1000px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    text-align: left;
}

.footer-col h4 {
    color: #ffffff;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.footer-col p {
    margin: 8px 0;
    line-height: 1.6;
    font-size: 0.95rem;
    color: #bdc3c7;
}

.footer-col a {
    color: #3498db;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-col a:hover {
    color: #2ecc71;
    text-decoration: underline;
}

.footer-bottom {
    text-align: center;
    padding-top: 25px;
    margin-top: 40px;
    border-top: 1px solid #34495e;
    font-size: 0.85rem;
    color: #95a5a6;
}

.footer-bottom p {
    margin: 0;
}