/* =========================================
   1. VARIABLES & THEME SETUP
   ========================================= */
:root {
    /* Color Palette - Premium Mosque Theme */
    --primary-color: #0F4C3A;
    /* Deep Emerald Green */
    --primary-dark: #083025;
    /* Darker Green for hover/focus */
    --accent-color: #D4AF37;
    /* Metallic Gold */
    --accent-hover: #B5952B;
    /* Darker Gold */
    --text-dark: #2C3E50;
    /* Deep Blue-Grey for main text */
    --text-light: #5F6C7B;
    /* Lighter Grey for secondary text */
    --bg-light: #F9F9F7;
    /* Soft Cream / Off-white background */
    --white: #FFFFFF;

    /* Spacing & Layout */
    --container-width: 1200px;
    --header-height: 80px;
    --border-radius: 12px;

    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 6px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.12);

    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* =========================================
   2. GLOBAL RESET & TYPOGRAPHY
   ========================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    /* Fallback to sans-serif if not loaded */
    margin: 0;
    padding: 0;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    color: var(--primary-color);
    margin-top: 0;
    line-height: 1.3;
}

h1 {
    font-size: 2.5rem;
    font-weight: 700;
}

h2 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    position: relative;
    display: inline-block;
}

h3 {
    font-size: 1.5rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--accent-color);
}

img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    display: block;
}

ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* =========================================
   3. LAYOUT UTILITIES
   ========================================= */
.container {
    width: 90%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 15px;
}

section {
    padding: 60px 0;
    margin-bottom: 30px;
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    text-align: center;
    /* Center text globally */
}

section h2::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--accent-color);
    margin-top: 8px;
    border-radius: 2px;
}

/* =========================================
   4. HEADER & NAVIGATION
   ========================================= */
header {
    background: var(--white);
    height: var(--header-height);
    box-shadow: var(--shadow-md);
    position: sticky;
    top: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    border-bottom: 3px solid var(--accent-color);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.nav-left {
    display: flex;
    align-items: center;
    text-decoration: none;
    /* In case it's wrapped in an A tag */
}

.logo {
    height: 55px;
    margin-right: 15px;
    width: auto;
}

.club-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
    letter-spacing: 0.5px;
}

/* Desktop Navigation */
/* Desktop Navigation */
.nav-wrapper {
    display: contents;
    /* Allows children to be spaced by nav-container, enabling centering */
}

.nav-links {
    display: flex;
    gap: 25px;
    margin: 0;
    padding: 0;
}

.nav-links li a {
    font-weight: 600;
    color: var(--text-dark);
    font-size: 1rem;
    padding: 8px 0;
    position: relative;
}

.nav-links li a:hover,
.nav-links li a[aria-current="page"] {
    color: var(--primary-color);
}

.nav-links li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: var(--accent-color);
    transition: width 0.3s;
}

.nav-links li a:hover::after,
.nav-links li a[aria-current="page"]::after {
    width: 100%;
}

/* Mobile Menu Toggle (Hidden by default on desktop) */
.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--primary-color);
    cursor: pointer;
}

/* Google Translate Widget - Premium/Clean Style */
#google_translate_element {
    /* Container positioning is handled by nav-wrapper */
}

/* Hide the Google Branding/Footer usually found immediately */
.goog-logo-link,
.goog-te-gadget span {
    display: none !important;
}

.goog-te-gadget {
    color: transparent !important;
    /* Hide "Powered by Google" text */
    font-size: 0 !important;
}

/* Style the clean dropdown button */
.goog-te-gadget-simple {
    background-color: rgba(15, 76, 58, 0.05) !important;
    /* Very light primary tint */
    border: 1px solid rgba(15, 76, 58, 0.2) !important;
    padding: 8px 12px !important;
    border-radius: 20px !important;
    font-size: 0.9rem !important;
    font-family: 'Poppins', sans-serif !important;
    font-weight: 500 !important;
    color: var(--primary-color) !important;
    display: flex !important;
    align-items: center;
    cursor: pointer;
    transition: var(--transition);
}

.goog-te-gadget-simple:hover {
    background-color: var(--primary-color) !important;
    color: var(--white) !important;
}

/* The actual text "Select Language" or current language */
.goog-te-menu-value {
    margin: 0 !important;
    color: inherit !important;
}

.goog-te-menu-value span:first-child {
    display: block !important;
    /* This is the language name */
    padding-right: 5px;
    font-size: 14px !important;
    font-weight: 600 !important;
    color: inherit !important;
}

/* Hide vertical separator bar */
.goog-te-menu-value span:nth-child(2) {
    display: none !important;
}

/* Custom Icon (using pseudo-element or just hiding the google one) */
.goog-te-gadget-icon {
    display: none !important;
}

/* Add a Globe Icon via CSS before the text if desired, or keep it simple */
.goog-te-gadget-simple::before {
    content: '🌐';
    margin-right: 8px;
    font-size: 1.1em;
    filter: grayscale(100%);
    /* Optional: make it neutral */
}

.goog-te-gadget-simple:hover::before {
    filter: none;
}

/* Redesigned Dropdown (Legacy support / Mobile View) */
/* We will transform the previous 'dropdown' to a mobile menu sidebar or drop-down list */
@media (max-width: 900px) {
    .nav-wrapper {
        /* On mobile, the wrapper (Menu + Translate) becomes the drawer content */
        position: absolute;
        top: var(--header-height);
        left: 0;
        width: 100%;
        background: var(--white);
        flex-direction: column;
        align-items: center;
        padding: 20px 0;
        gap: 20px;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);

        display: none;
        /* Hidden by default */
        opacity: 0;
        transform: translateY(-20px);
        transition: opacity 0.3s ease, transform 0.3s ease;
        border-top: 1px solid rgba(0, 0, 0, 0.05);
    }

    .nav-wrapper.active {
        display: flex;
        opacity: 1;
        transform: translateY(0);
    }

    /* Legacy Support for pages without nav-wrapper */
    .nav-links:not(.nav-wrapper .nav-links) {
        display: none;
        flex-direction: column;
        position: absolute;
        top: var(--header-height);
        left: 0;
        width: 100%;
        background: var(--white);
        box-shadow: var(--shadow-lg);
        padding: 20px;
        gap: 15px;
        text-align: center;
        border-top: 1px solid #eee;
    }

    .nav-links.active:not(.nav-wrapper .nav-links) {
        display: flex;
        animation: slideDown 0.3s ease-out;
    }

    .nav-links {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }

    .mobile-menu-btn {
        display: block;
    }

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

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* =========================================
   5. HERO SECTION (New)
   ========================================= */
.hero-section {
    background: linear-gradient(rgba(15, 76, 58, 0.85), rgba(15, 76, 58, 0.7)), url('Moschee Innenraum9.jpg');
    /* Fallback image or ensure this path is correct based on list_dir */
    background-size: cover;
    background-position: center;
    color: var(--white);
    padding: 100px 20px;
    text-align: center;
    margin-bottom: 40px;
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    box-shadow: var(--shadow-md);
}

.hero-content h1 {
    color: var(--accent-color);
    font-size: 3rem;
    margin-bottom: 20px;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-content p {
    font-size: 1.25rem;
    max-width: 700px;
    margin: 0 auto 30px;
    opacity: 0.9;
}

.hero-buttons .btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 10px;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--accent-color);
    color: var(--primary-dark);
}

.btn-primary:hover {
    background-color: var(--white);
    color: var(--primary-color);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.3);
}

.btn-outline {
    border: 2px solid var(--white);
    color: var(--white);
}

.btn-outline:hover {
    background-color: var(--white);
    color: var(--primary-color);
}

/* =========================================
   6. COMPONENT: NEWS (Updates to existing)
   ========================================= */
.news-section {
    padding: 40px;
}

.news-container {
    position: relative;
    overflow: hidden;
    min-height: 400px;
    /* Increased height for better layout */
}

/* Improved Card Style for News */
.news-item {
    display: none;
    text-align: center;
    background: var(--white);
    padding: 0;
}

.news-item.active-news {
    display: block;
    animation: fadeIn 0.6s ease;
}

.news-image {
    width: 100%;
    height: 350px;
    object-fit: cover;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    box-shadow: var(--shadow-sm);
}

.news-item h3 {
    font-size: 1.8rem;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.news-controls {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}

.news-controls button {
    background: var(--white);
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    padding: 10px 25px;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
}

.news-controls button:hover {
    background: var(--primary-color);
    color: var(--white);
}

/* =========================================
   7. COMPONENT: DONATION & WIDGETS
   ========================================= */
.donation-section,
.radio-section,
.contact-section {
    padding: 40px;
    text-align: center;
}

.donate-button {
    background: var(--primary-color);
    color: var(--white);
    padding: 15px 40px;
    border-radius: 50px;
    font-size: 1.1rem;
    box-shadow: var(--shadow-md);
    display: inline-block;
    margin-top: 20px;
}

.donate-button:hover {
    background: var(--accent-color);
    color: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
}

.prayer-times-section {
    text-align: center;
    background-color: var(--bg-light);
    padding: 60px 20px;
}

.widget-container {
    max-width: 600px;
    /* Limit width */
    margin: 30px auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    /* Premium soft shadow */
    border: 1px solid rgba(0, 0, 0, 0.05);
    background: white;
    /* Ensure bg is white behind iframe */
}

.widget-iframe {
    width: 100%;
    height: 480px;
    /* Slightly taller for comfort */
    border: none;
    display: block;
}

/* =========================================
   8. FOOTER
   ========================================= */
footer {
    background: var(--primary-dark);
    color: var(--white);
    padding: 60px 0 30px;
    margin-top: 60px;
    text-align: center;
}

.footer-content p {
    opacity: 0.8;
}

.footer-nav ul {
    margin-top: 20px;
}

.footer-nav ul li {
    display: inline-block;
    margin: 0 15px;
}

.footer-nav ul li a {
    color: var(--accent-color);
    font-weight: 500;
}

.footer-nav ul li a:hover {
    color: var(--white);
    text-decoration: underline;
}

/* =========================================
   9. LEGACY PAGE SPECIFIC STYLES
   (Preserving functionality for other pages)
   ========================================= */

/* Photos/Gallery */
.photo-gallery-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    /* Slightly better grid */
    gap: 20px;
    padding: 20px;
}

.gallery-thumbnail {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
}

.gallery-thumbnail:hover {
    transform: scale(1.02);
    box-shadow: var(--shadow-lg);
}

/* Lightbox */
.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    align-items: center;
    justify-content: center;
}

.lightbox-image {
    max-width: 90%;
    max-height: 85vh;
    border-radius: 8px;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.5);
    animation: zoomIn 0.3s;
}

.lightbox-close {
    position: absolute;
    top: 30px;
    right: 40px;
    color: var(--white);
    font-size: 3rem;
    cursor: pointer;
    border: none;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    border: none;
    font-size: 3rem;
    padding: 20px;
    cursor: pointer;
    transition: var(--transition);
    z-index: 2001;
    border-radius: 5px;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.3);
}

.lightbox-prev {
    left: 20px;
}

.lightbox-next {
    right: 20px;
}

/* Mobile adjustments for lightbox buttons */
@media (max-width: 768px) {

    .lightbox-prev,
    .lightbox-next {
        font-size: 2.5rem;
        padding: 15px;
        background: rgba(0, 0, 0, 0.3);
        /* Higher contrast on mobile */
    }

    .lightbox-prev {
        left: 10px;
    }

    .lightbox-next {
        right: 10px;
    }
}

/* Calendar Grid */
.calendar-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.calendar-image {
    border: 3px solid var(--accent-color);
    /* Gold border for calendars */
    border-radius: var(--border-radius);
}

/* Events (Veranstaltungen) */
.event-item {
    background: var(--white);
    border: 1px solid #eee;
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-bottom: 20px;
    transition: var(--transition);
}

.event-item:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.event-header {
    background: linear-gradient(to right, #f8f9fa, #fff);
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    cursor: pointer;
}

.event-date {
    background: var(--primary-color);
    color: var(--white);
    padding: 8px 15px;
    border-radius: 6px;
    font-weight: 700;
    text-align: center;
    min-width: 80px;
}

.event-title {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-dark);
}

/* Contact Form */
input[type="text"],
input[type="email"],
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 20px;
    font-family: inherit;
    transition: var(--transition);
    background: #fdfdfd;
}

input:focus,
textarea:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(15, 76, 58, 0.1);
}

/* Vorstand */
.vorstand-list {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 20px;
}

.vorstand-list li {
    background: var(--white);
    padding: 15px 30px;
    border-radius: 50px;
    border: 1px solid var(--accent-color);
    color: var(--primary-color);
    font-weight: 600;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes zoomIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}