/*
 * Enhanced Modern Design for myMasjid
 * Blending original green theme with modern iOS-inspired aesthetics
 * Includes Masjid Detail Page Styles
 */

/* ==================== FONT FACES ==================== */
@font-face {
    font-family: 'SF Pro Display';
    src: url('/assets/fonts/SF-Pro-Display-Regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
}

@font-face {
    font-family: 'SF Pro Display';
    src: url('/assets/fonts/SF-Pro-Display-Medium.otf') format('opentype');
    font-weight: 500;
    font-style: normal;
}

@font-face {
    font-family: 'SF Pro Display';
    src: url('/assets/fonts/SF-Pro-Display-Semibold.otf') format('opentype');
    font-weight: 600;
    font-style: normal;
}

@font-face {
    font-family: 'SF Pro Display';
    src: url('/assets/fonts/SF-Pro-Display-Bold.otf') format('opentype');
    font-weight: 700;
    font-style: normal;
}

@font-face {
    font-family: 'SF Pro Text';
    src: url('/assets/fonts/SF-Pro-Text-Regular.otf') format('opentype');
    font-weight: 400;
    font-style: normal;
}

/* ==================== CSS VARIABLES (Updated with original theme) ==================== */
:root {
    color-scheme: light;

    /* Primary Colors - Original Green Theme */
    --primary: #C8D829;
    --primary-dark: #a0ac1f;
    --primary-light: #e5ef5e;
    --primary-gradient: linear-gradient(135deg, #C8D829 0%, #E5EF5E 100%);
    --primary-gradient-dark: linear-gradient(135deg, #a0ac1f 0%, #C8D829 100%);

    /* Secondary Colors */
    --secondary: #5d630f;
    --secondary-light: #7e8812;
    --secondary-dark: #313416;

    /* Accent Colors */
    --accent: #2bd184;
    --accent-light: #8fdfa2;
    --success: #038522;
    --warning: #f67a22;
    --info: #0dcaf0;
    --danger: #ea5c5c;
    --danger-light: #ff8787;

    /* Neutral Colors - Enhanced */
    --white: #FFFFFF;
    --black: #000000;
    --gray-50: #FAFBFC;
    --gray-100: #F4F5F7;
    --gray-200: #E8EAED;
    --gray-300: #D3D6DB;
    --gray-400: #9FA6B2;
    --gray-500: #6B7280;
    --gray-600: #4B5563;
    --gray-700: #374151;
    --gray-800: #1F2937;
    --gray-900: #111827;

    /* Theme-specific colors */
    --theme-green: #C8D829;
    --theme-yellow: #ccdc21;
    --theme-olive: #5d630f;
    --theme-light-green: #eff6b1;
    --theme-border-green: rgba(178, 187, 0, 0.62);

    /* Background Colors */
    --bg-primary: #FFFFFF;
    --bg-secondary: #FAFCF0;
    --bg-tertiary: #F5F7E9;
    --bg-glass: rgba(255, 255, 255, 0.95);
    --bg-green-light: rgba(200, 216, 41, 0.08);
    --bg-green-medium: rgba(200, 216, 41, 0.15);

    /* Text Colors - FIXED FOR BETTER CONTRAST */
    --text-primary: #1F2937;
    --text-secondary: #5d630f;
    --text-tertiary: #7e8812;
    --text-light: #6B7280;
    --text-inverse: #FFFFFF;

    /* Border & Divider */
    --border-color: #e0e4bb;
    --border-light: rgba(178, 187, 0, 0.2);
    --border-medium: rgba(178, 187, 0, 0.38);
    --border-dark: rgba(178, 187, 0, 0.62);
    --divider: rgba(0, 0, 0, 0.08);

    /* Shadows - Enhanced with theme colors */
    --shadow-xs: 0 1px 2px rgba(200, 216, 41, 0.04);
    --shadow-sm: 0 2px 8px rgba(200, 216, 41, 0.06);
    --shadow-md: 0 4px 16px rgba(200, 216, 41, 0.08);
    --shadow-lg: 0 8px 32px rgba(200, 216, 41, 0.12);
    --shadow-xl: 0 12px 48px rgba(200, 216, 41, 0.16);
    --shadow-colored: 0 8px 32px rgba(200, 216, 41, 0.2);

    /* Border Radius */
    --radius-xs: 4px;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    --radius-2xl: 24px;
    --radius-full: 9999px;

    /* Spacing */
    --spacing-xs: 4px;
    --spacing-sm: 8px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;
    --spacing-2xl: 48px;
    --spacing-3xl: 64px;

    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-fast: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);

    /* Typography */
    --font-display: 'SF Pro Display', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
    --font-text: 'SF Pro Text', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

    /* Z-Index Scale */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;
    --bs-btn-active-color :#fff;
    --bs-btn-active-bg: #3b7335;
}

/* Dark Mode Support with Theme Colors
@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: light;

        --bg-primary: #1b1c00;
        --bg-secondary: #303200;
        --bg-tertiary: #1e1f22;
        --bg-glass: rgba(27, 28, 0, 0.95);

        --text-primary: #F9FAFB;
        --text-secondary: #e0e4bb;
        --text-tertiary: #C8D829;
        --text-light: #9CA3AF;

        --border-color: #313400;
        --divider: rgba(200, 216, 41, 0.1);

        --theme-green: #a0ac1f;
        --theme-yellow: #C8D829;

        --bg-green-light: rgba(160, 172, 31, 0.15);
        --bg-green-medium: rgba(160, 172, 31, 0.25);
    }
}
*/
/* ==================== GLOBAL STYLES ==================== */
* {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-text);
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

/* ==================== NAVBAR (Modern with Theme Colors) ==================== */
.navbar-modern {
    background: var(--primary-gradient-dark);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow-md);
    border: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 0.75rem 0;
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    transition: var(--transition);
}

.navbar-modern .navbar-brand {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.5rem;
    letter-spacing: -0.03em;
    color: var(--secondary) !important;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    transition: var(--transition);
}

.navbar-modern .navbar-brand:hover {
    transform: translateY(-2px);
    color: var(--secondary-dark) !important;
}

.navbar-modern .navbar-brand img {
    height: 36px;
    width: auto;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.15));
}

.navbar-modern .nav-link {
    font-family: var(--font-text);
    font-weight: 500;
    font-size: 0.95rem;
    color: rgba(93, 99, 15, 0.9) !important;
    padding: 0.5rem 1rem;
    margin: 0 0.25rem;
    border-radius: var(--radius-sm);
    transition: var(--transition-fast);
    position: relative;
}

.navbar-modern .nav-link:hover {
    background-color: rgba(200, 216, 41, 0.2);
    color: var(--secondary-dark) !important;
    transform: translateY(-1px);
}

.navbar-modern .nav-link.active {
    background-color: rgba(200, 216, 41, 0.3);
    color: var(--secondary-dark) !important;
    font-weight: 600;
}

.navbar-modern .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 60%;
    height: 2px;
    background: var(--secondary);
    border-radius: var(--radius-full);
    transition: transform 0.3s ease;
}

.navbar-modern .nav-link:hover::after,
.navbar-modern .nav-link.active::after {
    transform: translateX(-50%) scaleX(1);
}

.navbar-modern .dropdown-menu {
    border: none;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem;
    margin-top: 0.5rem;
    background: var(--white);
    border: 1px solid var(--border-light);
}

.navbar-modern .dropdown-item {
    border-radius: var(--radius-sm);
    padding: 0.625rem 1rem;
    margin-bottom: 0.25rem;
    transition: var(--transition-fast);
    font-weight: 500;
    color: var(--text-primary) !important;
    display: flex;
    align-items: center;
}

.navbar-modern .dropdown-item:hover {
    background-color: var(--bg-green-light);
    color: var(--secondary) !important;
    transform: translateX(4px);
}

.navbar-modern .dropdown-item i {
    color: var(--text-tertiary);
    transition: var(--transition-fast);
}

.navbar-modern .dropdown-item:hover i {
    color: var(--secondary);
}

/* Language Switcher */
.language-switcher {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.language-switcher a {
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    font-size: 0.875rem;
    color: var(--secondary) !important;
    transition: var(--transition-fast);
    text-decoration: none;
    background: rgba(255, 255, 255, 0.3);
}

.language-switcher a:hover {
    background-color: rgba(200, 216, 41, 0.3);
    color: var(--secondary-dark) !important;
}

.language-switcher a.active {
    background-color: rgba(200, 216, 41, 0.5);
    color: var(--secondary-dark) !important;
    font-weight: 600;
}

/* ==================== BUTTONS ==================== */
.btn {
    font-family: var(--font-text);
    font-weight: 600;
    border-radius: var(--radius-md);
    padding: 0.625rem 1.5rem;
    transition: var(--transition);
    border: none;
    letter-spacing: -0.01em;
}

.btn-primary {
    background: var(--primary-gradient);
    color: var(--secondary) !important;
    box-shadow: var(--shadow-colored);
    border: 1px solid var(--primary-dark);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-xl);
    background: var(--primary-gradient-dark);
    color: var(--secondary-dark) !important;
}

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

.btn-outline-primary:hover {
    background: var(--primary);
    color: var(--secondary) !important;
    transform: translateY(-2px);
    box-shadow: var(--shadow-colored);
}

/* ==================== CARDS (Enhanced with Theme) ==================== */
.card-modern {
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    overflow: hidden;
}

.card-modern:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-medium);
}

.card-modern .card-header {
    background: linear-gradient(135deg, var(--bg-green-light) 0%, transparent 100%);
    border-bottom: 1px solid var(--border-light);
    padding: 1.5rem;
    font-weight: 600;
    font-size: 1.25rem;
    color: var(--text-secondary);
}

.card-modern .card-body {
    padding: 1.5rem;
    color: var(--text-primary); /* Ensure text is visible */
}

.card-modern .card-footer {
    background: var(--bg-tertiary);
    border-top: 1px solid var(--border-light);
    padding: 1rem 1.5rem;
}

/* Quran Card Specific */
.quran-card {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    transition: var(--transition);
}

.quran-card:hover {
    border-color: var(--border-medium);
    box-shadow: var(--shadow-md);
}

.quran-card .card-footer {
    background: transparent;
    border-top: 1px solid var(--border-light);
    padding: 1rem;
}

/* Article Index */
.article-index-list {
    background: var(--bg-green-light);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    transition: var(--transition);
    color: var(--text-primary); /* Ensure text is visible */
}

.article-index-list:hover {
    border-color: var(--border-medium);
    box-shadow: var(--shadow-sm);
}

/* ==================== BADGES ==================== */
.badge {
    padding: 0.375rem 0.75rem;
    border-radius: var(--radius-full);
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.02em;
    border: 1px solid transparent;
}

.badge-primary {
    background: var(--primary-gradient);
    color: var(--secondary) !important;
    border-color: var(--primary-dark);
}

.badge-success {
    background: var(--success);
    color: var(--white) !important;
}

.badge-info {
    background: var(--info);
    color: var(--white) !important;
}

/* Topic Info Badges */
.topic-info-view {
    background: rgba(131, 146, 243, 0.76);
    color: var(--white);
}

.topic-info-comments {
    background: rgba(40, 167, 69, 0.76);
    color: var(--white);
}

.topic-info-photo {
    background: var(--danger);
    color: var(--white);
}

.topic-info-video {
    background: var(--warning);
    color: var(--white);
}

/* ==================== FORMS ==================== */
.form-control {
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    font-family: var(--font-text);
    font-size: 1rem;
    transition: var(--transition-fast);
    background-color: var(--white);
    color: var(--text-primary); /* Ensure text is visible */
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(200, 216, 41, 0.1);
    outline: none;
}

/* ==================== SPECIAL COMPONENTS ==================== */
/* Prayer Time Cards */
.ws-col {
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1rem;
    background: var(--white);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    margin: 0.5rem;
    color: var(--text-primary); /* Ensure text is visible */
}

.ws-col:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--border-medium);
}

.ws-puasa {
    background: linear-gradient(135deg, var(--bg-green-light) 0%, transparent 100%);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    padding: 1rem;
    text-align: center;
    color: var(--text-primary); /* Ensure text is visible */
}

.ws-puasa-isninkhamis {
    background: rgba(178, 187, 0, 0.15);
}

.ws-puasa-putih {
    background: rgba(212, 143, 24, 0.15);
}

/* Forum Components */
.forum_dialog {
    background: var(--bg-green-light);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    padding: 1rem;
    margin: 1rem 0;
    color: var(--text-primary); /* Ensure text is visible */
}

.actorPic {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--white);
    box-shadow: var(--shadow-sm);
}

/* Video Cards */
.youtube-card-body {
    background-size: cover;
    background-position: center;
    height: 200px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.youtube-card-body::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.3));
}

/* ==================== MASJID DETAIL PAGE STYLES ==================== */
.masjid-hero {
    /*background: var(--primary-gradient-dark);*/
    padding: 3rem 0;
    color: var(--text-inverse);
    position: relative;
    overflow: hidden;
}

.masjid-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1440 320"><path fill="%23ffffff" fill-opacity="0.1" d="M0,96L48,112C96,128,192,160,288,160C384,160,480,128,576,112C672,96,768,96,864,112C960,128,1056,160,1152,160C1248,160,1344,128,1392,112L1440,96L1440,320L1392,320C1344,320,1248,320,1152,320C1056,320,960,320,864,320C768,320,672,320,576,320C480,320,384,320,288,320C192,320,96,320,48,320L0,320Z"></path></svg>');
    background-size: cover;
    background-position: bottom;
}

.masjid-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}


.action-bar {
    position: sticky;
    top: 80px;
    z-index: var(--z-sticky);
    background: var(--bg-primary);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
    margin-bottom: 2rem;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    border-radius: 15px;
}

.action-buttons {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.action-btn {
    display: flex;
    font-size: 0.8rem;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem 1.25rem;
    border-radius: 10px;
    font-weight: 600;
    transition: var(--transition);
    border: 2px solid transparent;
    color: var(--text-primary); /* Ensure text is visible */
}

.action-btn-primary {
    background: var(--primary-gradient);
    color: var(--secondary) !important;
    border-color: var(--primary-dark);
}

.action-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-colored);
}

.action-btn-outline {
    background: transparent;
    border: 2px solid var(--border-color);
    color: var(--text-primary);
}

.action-btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    transform: translateY(-2px);
}

.section-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    margin-bottom: 2rem;
    overflow: hidden;
    transition: var(--transition);
    color: var(--text-primary); /* Ensure text is visible */
}

.section-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-medium);
}

.section-card-header {
    background: linear-gradient(135deg, var(--bg-green-light) 0%, transparent 100%);
    padding: 1rem;
    border-bottom: 1px solid var(--border-light);
}

.section-card-header h3 {
    margin: 0;
    color: var(--text-secondary);
    font-weight: 600;
    display: flex;
    align-items: center;
    font-size: 1.3rem;
    gap: 0.75rem;
}

.section-card-header h3 i {
    color: var(--primary);
}

.section-card-body {
    padding: 1rem;
    color: var(--text-primary); /* Ensure text is visible */
}

.section-card-footer {
    padding: 0.3rem;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.5rem;
    background: var(--bg-green-light);
    border-radius: var(--radius-lg);
    transition: var(--transition);
    color: var(--text-primary); /* Ensure text is visible */
    border-color: var(--primary-dark);
    border-width: 1px;
    border-style: solid;}

.contact-item:hover {
    transform: translateY(-2px);
    background: var(--bg-green-medium);
}

.contact-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-gradient);
    color: var(--secondary);
    border-radius: var(--radius-lg);
    font-size: 1.25rem;
}

.contact-details h5 {
    margin: 0 0 0.25rem 0;
    color: var(--text-secondary);
    font-weight: 600;
    font-size: 1rem;
}

.contact-details p {
    margin: 0;
    color: var(--text-primary);
}

.contact-details a {
    color: var(--primary-dark);
    text-decoration: none;
    transition: var(--transition-fast);
}

.contact-details a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

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

.photo-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: var(--transition);
}

.photo-item:hover {
    transform: scale(1.03);
    box-shadow: var(--shadow-md);
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.photo-item:hover img {
    transform: scale(1.1);
}

.photo-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0,0,0,0.7));
    color: white;
    padding: 1rem;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.photo-item:hover .photo-caption {
    transform: translateY(0);
}

.checkin-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.checkin-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-green-light);
    border-radius: var(--radius-lg);
    transition: var(--transition);
    color: var(--text-primary); /* Ensure text is visible */
}

.checkin-item:hover {
    transform: translateX(4px);
    background: var(--bg-green-medium);
}

.checkin-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--bg-primary);
    box-shadow: var(--shadow-sm);
}

.checkin-content {
    flex: 1;
}

.checkin-content h6 {
    margin: 0 0 0.25rem 0;
    color: var(--text-secondary);
    font-weight: 600;
}

.checkin-content p {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
}

.checkin-meta {
    display: flex;
    align-items: center;
    gap: 1rem;
    color: var(--text-light);
    font-size: 0.875rem;
}

.checkin-image {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    object-fit: cover;
    box-shadow: var(--shadow-sm);
}

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

.service-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--bg-green-light);
    border-radius: var(--radius-lg);
    transition: var(--transition);
    color: var(--text-primary); /* Ensure text is visible */
}

.service-item:hover {
    transform: translateY(-2px);
    background: var(--bg-green-medium);
}

.service-item i {
    color: var(--success);
    font-size: 1.25rem;
}

/* Map Styles */
#map {
    height: 400px;
    width: 100%;
    border-radius: 0px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.leaflet-popup-content {
    font-family: var(--font-text);
}

.leaflet-popup-content h6 {
    margin: 0 0 0.5rem 0;
    color: var(--text-secondary);
    font-weight: 600;
}

/* ==================== LAYOUT SYSTEM ==================== */
.content-wrapper {
    display: flex;
    gap: var(--spacing-lg);
    align-items: flex-start;
}

.main-content {
    flex: 1;
    min-width: 0;
}

.sidebar {
    width: 100%;
    max-width: 350px;
    position: sticky;
    top: 80px;
}

/* Sidebar Cards */
.sidebar-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    color: var(--text-primary); /* Ensure text is visible */
}

.sidebar-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--border-medium);
}

.sidebar-card h5 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Advertisement Card */
.ad-card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 0.5rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    margin-bottom: 1.5rem;
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.ad-card img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    transition: var(--transition);
}

.ad-card:hover img {
    transform: scale(1.02);
}

/* ==================== FOOTER ==================== */
.footer-modern {
    background: linear-gradient(135deg, var(--secondary-dark) 0%, var(--secondary) 100%);
    color: var(--text-inverse);
    padding: 3rem 0 1.5rem;
    margin-top: 4rem;
    border-top: 1px solid var(--primary);
}

.footer-modern a {
    color: rgba(255, 255, 255, 0.8);
    transition: var(--transition-fast);
    text-decoration: none;
}

.footer-modern a:hover {
    color: var(--primary-light);
}

.footer-modern h5, .footer-modern h6 {
    color: var(--white);
}

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

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

@keyframes pulse-green {
    0%, 100% {
        box-shadow: 0 0 0 0 rgba(200, 216, 41, 0.4);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(200, 216, 41, 0);
    }
}

.pulse-green {
    animation: pulse-green 2s infinite;
}

/* Now Prayer Time Animation */
@keyframes blink-green {
    0%, 100% {
        background-color: var(--bg-primary);
        box-shadow: var(--shadow-sm);
    }
    50% {
        background-color: var(--primary-light);
        box-shadow: 0 0 20px rgba(200, 216, 41, 0.3);
    }
}

.now-div {
    animation: blink-green 3s infinite;
}

/* Loading Animation */
@keyframes shimmer {
    0% { background-position: -200px 0; }
    100% { background-position: 200px 0; }
}

.loading {
    background: linear-gradient(90deg, var(--gray-100) 25%, var(--gray-200) 50%, var(--gray-100) 75%);
    background-size: 200px 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--radius-md);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 991px) {
    .navbar-modern .navbar-collapse {
        background: rgba(255, 255, 255, 0.98);
        border-radius: var(--radius-md);
        padding: 1rem;
        margin-top: 1rem;
        box-shadow: var(--shadow-lg);
        border: 1px solid var(--border-light);
    }

    .content-wrapper {
        flex-direction: column;
    }

    .sidebar {
        max-width: 100%;
        position: static;
        margin-top: 2rem;
    }

    /* Masjid Detail Responsive */
    .action-bar {
        position: static;
        margin-bottom: 1rem;

    }

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

    .action-btn {
        width: 100%;
        justify-content: center;
    }

    .masjid-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .photos-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }

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

    .services-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 768px) {
    .navbar-modern .navbar-brand {
        font-size: 1.25rem;
    }

    .navbar-modern .navbar-brand img {
        height: 28px;
    }

    .quran-card .card-body {
        font-size: 1.2rem;
        padding: 1rem;
    }

    .masjid-hero {
        padding: 2rem 0;
        padding-bottom: 0px;
    }
}

@media (max-width: 480px) {
    .masjid-stats {
        grid-template-columns: 1fr;
    }

    .photos-grid {
        grid-template-columns: 1fr;
    }

    .checkin-item {
        flex-direction: column;
        text-align: center;
    }

    .checkin-image {
        width: 100%;
        height: 200px;
        margin-top: 1rem;
    }
}

/* ==================== UTILITY CLASSES ==================== */
.bg-green-light {
    background-color: var(--bg-green-light) !important;
}

.border-theme {
    border-color: var(--border-light) !important;
}

.text-theme {
    color: var(--text-secondary) !important;
}

.shadow-theme {
    box-shadow: var(--shadow-colored) !important;
}

/* Ensure text is always visible */
.container, .container-fluid, .row, .col, [class*="col-"] {
    color: var(--text-primary) !important;
}

/* Fix for white text on white background */
.text-white {
    color: var(--text-inverse) !important;
}

.text-muted {
    color: var(--text-light) !important;
}

/* RTL Support */
[dir="rtl"] .navbar-modern .dropdown-item:hover {
    transform: translateX(-4px);
}

[dir="rtl"] .language-switcher {
    flex-direction: row-reverse;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}