/* ==========================================================================
   MAHEV INTERNATIONAL — DESIGN SYSTEM & GRAPHIC CHARTER
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;700;800;900&family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
    /* Color Palette */
    --primary-color: #0d47a1;       /* Royal Blue */
    --primary-light: #42a5f5;
    --primary-dark: #002171;
    --secondary-color: #d4af37;     /* Metallic Gold */
    --secondary-light: #ffdf00;
    --secondary-dark: #aa7c11;
    --accent-color: #10b981;        /* Success/Green */
    --danger-color: #ef4444;        /* Error/Red */
    
    /* Light Mode Colors */
    --bg-main: #f8fafc;
    --bg-card: #ffffff;
    --bg-nav: rgba(255, 255, 255, 0.9);
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --border-color: #e2e8f0;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.4);
    
    /* Typography */
    --font-heading: 'Montserrat', sans-serif;
    --font-body: 'Outfit', sans-serif;
    
    /* Transitions */
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Layout */
    --max-width: 1280px;
    --header-height: 80px;
}

/* Dark Mode Overrides */
[data-theme="dark"] {
    --bg-main: #0b0f19;
    --bg-card: #151d30;
    --bg-nav: rgba(11, 15, 25, 0.9);
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border-color: #1e293b;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.5), 0 2px 4px -2px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.5);
    --glass-bg: rgba(15, 23, 42, 0.7);
    --glass-border: rgba(255, 255, 255, 0.05);
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
    height: 100%;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-main);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color var(--transition-normal), color var(--transition-normal);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 0.5em;
    color: var(--text-primary);
}

h1 {
    font-weight: 900;
    font-size: 2.5rem;
    letter-spacing: -0.025em;
}

h2 {
    font-size: 2rem;
    position: relative;
    padding-bottom: 0.5rem;
}

h2.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    border-radius: 2px;
}

h2.section-title.center::after {
    left: 50%;
    transform: translateX(-50%);
}

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

img, video {
    max-width: 100%;
    height: auto;
    display: block;
}

ul {
    list-style: none;
}

button, input, textarea, select {
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    background: none;
    border: none;
    outline: none;
}

/* ==========================================================================
   LAYOUT CONTAINERS
   ========================================================================== */

.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

.section {
    padding: 5rem 0;
}

.section-alt {
    background-color: var(--bg-card);
}

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

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

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
}

@media (max-width: 1024px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .grid-2, .grid-3, .grid-4 {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .section {
        padding: 3.5rem 0;
    }
}

/* ==========================================================================
   HEADER & NAVIGATION
   ========================================================================== */

.header {
    height: var(--header-height);
    background-color: var(--bg-nav);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--glass-border);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: background-color var(--transition-normal), transform var(--transition-normal);
}

.header.scrolled {
    box-shadow: var(--shadow-md);
}

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

.logo-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-img {
    height: 55px;
    width: auto;
    object-fit: contain;
}

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

.logo-title {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--primary-color);
    letter-spacing: 1px;
    line-height: 1.1;
}

.logo-subtitle {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: var(--secondary-dark);
    font-weight: 600;
}

.navbar {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

/* Nav Item Wrapper for Dropdown */
.nav-item {
    position: relative;
}

.nav-link {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.5rem 0.25rem;
    position: relative;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--secondary-color);
    transition: width var(--transition-fast);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link.active {
    color: var(--primary-color);
}

/* Dropdown Menu Styles */
.nav-dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(15px);
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-normal);
    z-index: 1000;
    padding: 0.75rem 0;
    overflow: hidden;
}

.nav-item:hover .nav-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.dropdown-link {
    display: block;
    padding: 0.6rem 1.5rem;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-primary);
    transition: all var(--transition-fast);
}

.dropdown-link:hover {
    background-color: var(--primary-color);
    color: #ffffff !important;
    padding-left: 1.75rem;
}

.action-buttons {
    display: flex;
    align-items: center;
    gap: 1rem;
}


/* Buttons & CTAs */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 50px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all var(--transition-fast);
    box-shadow: var(--shadow-sm);
}

.btn-primary {
    background-color: var(--primary-color);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: #000000;
}

.btn-secondary:hover {
    background-color: var(--secondary-light);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

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

.btn-outline:hover {
    background-color: var(--primary-color);
    color: #ffffff;
    transform: translateY(-2px);
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--border-color);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.btn-icon:hover {
    background-color: var(--primary-color);
    color: #ffffff;
    transform: scale(1.05);
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
}

@media (max-width: 1024px) {
    .menu-toggle {
        display: block;
    }
    
    .navbar {
        position: fixed;
        top: var(--header-height);
        right: -100%;
        width: 300px;
        height: calc(100vh - var(--header-height));
        background-color: var(--bg-card);
        flex-direction: column;
        align-items: flex-start;
        padding: 2rem;
        gap: 1.5rem;
        box-shadow: var(--shadow-lg);
        transition: right var(--transition-normal);
        overflow-y: auto;
    }
    
    .navbar.open {
        right: 0;
    }
    
    .nav-link {
        width: 100%;
        font-size: 1.1rem;
        padding: 0.75rem 0;
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-link::after {
        display: none;
    }
    
    .action-buttons {
        width: 100%;
        flex-direction: column;
        margin-top: 1.5rem;
    }
    
    .action-buttons .btn {
        width: 100%;
    }
}

/* ==========================================================================
   APP VIEWS WRAPPER
   ========================================================================== */

.main-content {
    margin-top: var(--header-height);
    flex: 1 0 auto;
}

.view-section {
    display: none;
    animation: fadeIn var(--transition-slow);
}

.view-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   HERO BANNER & VIDEO BACKGROUND
   ========================================================================== */

.hero {
    height: calc(100vh - var(--header-height));
    position: relative;
    display: flex;
    align-items: center;
    color: #ffffff;
    overflow: hidden;
    text-align: center;
}

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

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(13, 71, 161, 0.35), rgba(15, 23, 42, 0.45));
    z-index: 2;
}

.hero-content {
    position: relative;
    z-index: 3;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1.5rem;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.9);
}

.hero-tagline {
    font-size: 1.25rem;
    color: var(--secondary-color);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 1rem;
    animation: slideDown 1s ease;
}

.hero-title {
    font-size: 4rem;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: #ffffff;
    text-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    animation: slideUp 1s ease;
}

.hero-title span {
    color: var(--secondary-color);
}

.hero-desc {
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    font-weight: 300;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    opacity: 0.9;
    animation: fadeIn 1.5s ease;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    animation: fadeIn 2s ease;
}

@media (max-width: 768px) {
    .hero-title { font-size: 2.25rem; }
    .hero-tagline { font-size: 1rem; }
    .hero-desc { font-size: 1rem; }
    .hero-buttons {
        flex-direction: column;
        gap: 1rem;
        align-items: center;
    }
    .hero-buttons .btn {
        width: 100%;
        max-width: 300px;
    }
}

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

@keyframes slideUp {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ==========================================================================
   CARDS & CONTAINERS
   ========================================================================== */

.card {
    background-color: var(--bg-card);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: all var(--transition-normal);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.card-img {
    height: 220px;
    overflow: hidden;
    position: relative;
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-slow);
}

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

.card-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background-color: var(--secondary-color);
    color: #000000;
    font-weight: 700;
    font-size: 0.7rem;
    padding: 0.35rem 0.75rem;
    border-radius: 50px;
    text-transform: uppercase;
}

.card-content {
    padding: 1.5rem;
}

.card-meta {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    display: flex;
    gap: 1rem;
    align-items: center;
}

.card-title {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.card-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 1.25rem;
}

/* ==========================================================================
   TEMPLE 5000 CAMPAIGN WIDGET
   ========================================================================== */

.temple-banner {
    background: linear-gradient(135deg, var(--primary-dark), #0f172a);
    color: #ffffff;
    border-radius: 24px;
    padding: 3.5rem;
    margin: 4rem 0;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.temple-banner::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.15) 0%, rgba(0, 0, 0, 0) 70%);
    pointer-events: none;
}

.temple-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 3rem;
    align-items: center;
}

.temple-title {
    color: #ffffff;
    font-size: 2.25rem;
    margin-bottom: 1rem;
}

.temple-title span {
    color: var(--secondary-color);
}

.temple-slogan {
    font-size: 1.1rem;
    color: var(--secondary-color);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 1.5px;
    margin-bottom: 1.5rem;
}

.temple-progress-container {
    margin: 2rem 0;
}

.temple-progress-bar {
    height: 16px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.temple-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--secondary-dark), var(--secondary-light));
    width: 64%; /* Static demo or JS updated */
    border-radius: 10px;
    position: relative;
    transition: width 2s cubic-bezier(0.1, 1, 0.1, 1);
}

.temple-progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0) 100%);
    animation: shine 2s infinite linear;
}

@keyframes shine {
    from { transform: translateX(-100%); }
    to { transform: translateX(100%); }
}

.temple-stats {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 1.1rem;
    margin-top: 0.5rem;
}

.temple-stats span:first-child {
    color: var(--secondary-color);
}

.temple-cards {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.temple-stat-card {
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
    text-align: center;
}

.temple-stat-value {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--secondary-light);
    font-family: var(--font-heading);
}

.temple-stat-label {
    font-size: 0.85rem;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 0.25rem;
}

@media (max-width: 900px) {
    .temple-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
    }
    .temple-banner {
        padding: 2rem;
    }
}

/* ==========================================================================
   PROGRAM OF THE WEEK GRID
   ========================================================================== */

.week-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 1rem;
    margin-top: 2rem;
}

.day-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    transition: all var(--transition-fast);
}

.day-card:hover, .day-card.today {
    border-color: var(--primary-color);
    background: linear-gradient(180deg, var(--bg-card) 0%, rgba(13, 71, 161, 0.05) 100%);
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.day-card.today {
    border-width: 2px;
    position: relative;
}

.day-card.today::before {
    content: 'Aujourd\'hui';
    position: absolute;
    top: -10px;
    left: 50%;
    transform: translateX(-50%);
    background-color: var(--primary-color);
    color: #ffffff;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
}

.day-name {
    font-weight: 800;
    font-size: 0.95rem;
    text-transform: uppercase;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}

.day-events {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.day-event-item {
    font-size: 0.8rem;
    border-top: 1px solid var(--border-color);
    padding-top: 0.5rem;
}

.day-event-time {
    font-weight: 700;
    color: var(--secondary-dark);
}

.day-event-name {
    font-weight: 600;
    color: var(--text-primary);
}

@media (max-width: 1024px) {
    .week-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .week-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

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

/* ==========================================================================
   PERSISTENT MULTI-PLATFORM LIVE STREAM PLAYER & MAHEV TV
   ========================================================================== */

.tv-container {
    display: grid;
    grid-template-columns: 1.4fr 0.6fr;
    gap: 2rem;
    margin-top: 2rem;
}

.player-card {
    background-color: #000000;
    border-radius: 16px;
    overflow: hidden;
    aspect-ratio: 16/9;
    position: relative;
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
}

.player-iframe {
    width: 100%;
    height: 100%;
    border: none;
}

.player-chat {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    height: 100%;
    max-height: 550px;
    box-shadow: var(--shadow-md);
}

.chat-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-live-badge {
    background-color: var(--danger-color);
    color: #ffffff;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 800;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 0.6; }
    50% { opacity: 1; }
    100% { opacity: 0.6; }
}

.chat-messages {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.chat-msg {
    font-size: 0.85rem;
    line-height: 1.4;
}

.chat-msg-user {
    font-weight: 700;
    color: var(--primary-color);
}

.chat-msg-text {
    color: var(--text-primary);
}

.chat-input-area {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.5rem;
}

.chat-input {
    flex: 1 1 auto;
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 0.5rem 1rem;
    font-size: 0.85rem;
}

@media (max-width: 900px) {
    .tv-container {
        grid-template-columns: 1fr;
    }
    .player-chat {
        height: 350px;
    }
}

/* Floating Live Player Mini Widget */
.floating-player {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 300px;
    background-color: #000000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 2px solid var(--secondary-color);
    z-index: 999;
    display: none; /* Toggle via JS when navigating */
    transition: all var(--transition-normal);
}

.floating-player-header {
    background-color: var(--primary-dark);
    color: #ffffff;
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.floating-player-close {
    cursor: pointer;
    font-weight: bold;
}

.floating-player-body {
    aspect-ratio: 16/9;
}

/* ==========================================================================
   PORTRAIT/MASONRY GALLERY & GRID
   ========================================================================== */

.masonry-grid {
    column-count: 3;
    column-gap: 1.5rem;
}

.masonry-item {
    display: inline-block;
    width: 100%;
    margin-bottom: 1.5rem;
    background-color: var(--bg-card);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--border-color);
    transition: transform var(--transition-fast);
}

.masonry-item:hover {
    transform: scale(1.02);
}

.masonry-item img {
    width: 100%;
    display: block;
}

.masonry-caption {
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
    font-weight: 600;
}

@media (max-width: 768px) {
    .masonry-grid {
        column-count: 2;
    }
}

@media (max-width: 480px) {
    .masonry-grid {
        column-count: 1;
    }
}

/* ==========================================================================
   INTERACTIVE FORMS (DONATION, PRAYER, REGISTRATION)
   ========================================================================== */

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
}

.form-input, .form-select, .form-textarea {
    width: 100%;
    background-color: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: border-color var(--transition-fast);
}

.form-input:focus, .form-select:focus, .form-textarea:focus {
    border-color: var(--primary-color);
    background-color: var(--bg-card);
}

.form-textarea {
    height: 120px;
    resize: none;
}

/* Donation custom selector */
.donation-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.donation-card {
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.donation-card:hover, .donation-card.active {
    border-color: var(--secondary-color);
    background-color: rgba(212, 175, 55, 0.05);
}

.donation-card.active {
    border-width: 2px;
}

.donation-card-tier {
    font-weight: 800;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-secondary);
}

.donation-card-amount {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary-color);
    margin: 0.5rem 0;
}

/* Payment gateway icons selection */
.payment-methods {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1.5rem 0;
}

.payment-method-btn {
    flex: 1 1 calc(33.3% - 1rem);
    border: 1px solid var(--border-color);
    padding: 0.75rem 1rem;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    background-color: var(--bg-card);
    transition: all var(--transition-fast);
}

.payment-method-btn:hover, .payment-method-btn.active {
    border-color: var(--primary-color);
    background-color: rgba(13, 71, 161, 0.05);
}

.payment-method-btn img {
    height: 25px;
    object-fit: contain;
}

/* ==========================================================================
   SHOP & LIBRARY
   ========================================================================== */

.shop-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 2rem;
}

.filter-sidebar {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    height: fit-content;
}

.filter-group {
    margin-bottom: 1.5rem;
}

.filter-title {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 0.75rem;
}

.filter-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.filter-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    cursor: pointer;
}

.filter-item input {
    cursor: pointer;
}

@media (max-width: 768px) {
    .shop-layout {
        grid-template-columns: 1fr;
    }
}

/* Shopping Cart Drawer */
.cart-drawer {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100%;
    background-color: var(--bg-card);
    box-shadow: var(--shadow-lg);
    z-index: 1100;
    transition: right var(--transition-normal);
    display: flex;
    flex-direction: column;
    border-left: 1px solid var(--border-color);
}

.cart-drawer.open {
    right: 0;
}

.cart-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-title {
    font-weight: 800;
    font-size: 1.25rem;
}

.cart-close {
    font-size: 1.5rem;
    cursor: pointer;
}

.cart-items {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 1.5rem;
}

.cart-item {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.25rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.25rem;
}

.cart-item-img {
    width: 60px;
    height: 80px;
    object-fit: cover;
    border-radius: 4px;
}

.cart-item-info {
    flex: 1 1 auto;
}

.cart-item-title {
    font-weight: 700;
    font-size: 0.95rem;
}

.cart-item-price {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.cart-item-qty-btn {
    width: 20px;
    height: 20px;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    cursor: pointer;
}

.cart-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-weight: 800;
    font-size: 1.15rem;
    margin-bottom: 1.5rem;
}

/* ==========================================================================
   ADMIN CRM DASHBOARD (SECURE PORTAL INTERFACE)
   ========================================================================== */

.crm-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    min-height: calc(100vh - var(--header-height));
    background-color: var(--bg-main);
}

.crm-sidebar {
    background-color: var(--bg-card);
    border-right: 1px solid var(--border-color);
    padding: 2rem 1.5rem;
}

.crm-menu {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.crm-menu-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.85rem 1.25rem;
    border-radius: 10px;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.crm-menu-item:hover, .crm-menu-item.active {
    background-color: var(--primary-color);
    color: #ffffff;
}

.crm-content {
    padding: 2.5rem;
    overflow-y: auto;
}

.crm-dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.crm-stat-card {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.crm-stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    background-color: rgba(13, 71, 161, 0.1);
    color: var(--primary-color);
}

.crm-stat-num {
    font-size: 1.75rem;
    font-weight: 800;
    line-height: 1.1;
}

.crm-stat-label {
    font-size: 0.8rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.crm-table-container {
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    margin-bottom: 2.5rem;
}

.crm-table-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.crm-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.crm-table th {
    background-color: var(--bg-main);
    padding: 1rem 1.5rem;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.crm-table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
    font-size: 0.9rem;
}

.crm-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.crm-badge-bronze { background-color: #d7ccc8; color: #5d4037; }
.crm-badge-argent { background-color: #cfd8dc; color: #455a64; }
.crm-badge-or { background-color: #ffe082; color: #ff8f00; }
.crm-badge-visionnaire { background-color: #d1c4e9; color: #512da8; }

.crm-badge-new { background-color: rgba(66, 165, 245, 0.15); color: #0d47a1; }
.crm-badge-member { background-color: rgba(16, 185, 129, 0.15); color: #10b981; }

.crm-badge-pending { background-color: rgba(243, 168, 26, 0.15); color: #aa7c11; }
.crm-badge-assigned { background-color: rgba(66, 165, 245, 0.15); color: #0d47a1; }

@media (max-width: 1024px) {
    .crm-layout {
        grid-template-columns: 1fr;
    }
    .crm-sidebar {
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    .crm-dashboard-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .crm-dashboard-grid {
        grid-template-columns: 1fr;
    }
}

/* ==========================================================================
   CHATBOT WIDGET
   ========================================================================== */

.bot-widget {
    position: fixed;
    bottom: 2rem;
    left: 2rem;
    z-index: 999;
}

.bot-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--primary-color);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    transition: transform var(--transition-fast);
}

.bot-btn:hover {
    transform: scale(1.05);
}

.bot-panel {
    position: absolute;
    bottom: 75px;
    left: 0;
    width: 350px;
    height: 450px;
    background-color: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
}

.bot-panel.open {
    display: flex;
}

.bot-header {
    background-color: var(--primary-color);
    color: #ffffff;
    padding: 1rem;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.bot-messages {
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.bot-msg {
    max-width: 80%;
    padding: 0.75rem 1rem;
    border-radius: 12px;
    font-size: 0.85rem;
}

.bot-msg-bot {
    background-color: var(--bg-main);
    color: var(--text-primary);
    align-self: flex-start;
    border-bottom-left-radius: 0;
}

.bot-msg-user {
    background-color: var(--primary-color);
    color: #ffffff;
    align-self: flex-end;
    border-bottom-right-radius: 0;
}

.bot-suggestions {
    padding: 0.5rem 1rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    border-top: 1px solid var(--border-color);
}

.bot-suggest-btn {
    background-color: rgba(13, 71, 161, 0.05);
    color: var(--primary-color);
    padding: 0.35rem 0.75rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid rgba(13, 71, 161, 0.1);
    transition: all var(--transition-fast);
}

.bot-suggest-btn:hover {
    background-color: var(--primary-color);
    color: #ffffff;
}

.bot-input-area {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    gap: 0.5rem;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.footer {
    background-color: #0b0f19;
    color: #94a3b8;
    padding: 5rem 0 2rem;
    border-top: 1px solid #1e293b;
    margin-top: auto;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr repeat(3, 1fr);
    gap: 3rem;
    margin-bottom: 4rem;
}

.footer-about-logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.25rem;
}

.footer-about-logo img {
    height: 50px;
}

.footer-about-title {
    color: #ffffff;
    font-size: 1.15rem;
    font-weight: 800;
}

.footer-about-desc {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.footer-socials {
    display: flex;
    gap: 0.75rem;
}

.footer-social-btn {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: #151d30;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    transition: all var(--transition-fast);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-social-btn:hover {
    background-color: var(--secondary-color);
    color: #000000;
    transform: translateY(-3px);
}

.footer-title {
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.5rem;
}

.footer-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background-color: var(--secondary-color);
}

.footer-links {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.footer-link {
    font-size: 0.9rem;
    transition: color var(--transition-fast);
}

.footer-link:hover {
    color: #ffffff;
}

.footer-contact-item {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.footer-contact-icon {
    color: var(--secondary-color);
    font-size: 1rem;
    margin-top: 0.15rem;
}

.footer-bottom {
    border-top: 1px solid #1e293b;
    padding-top: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
}

.footer-copy {
    line-height: 1.5;
}

.footer-copy span {
    color: var(--secondary-color);
}

.footer-bottom-links {
    display: flex;
    gap: 1.5rem;
}

@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2.5rem;
    }
}

@media (max-width: 600px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

/* ==========================================================================
   UTILITY CLASSES
   ========================================================================== */

.text-center { text-align: center; }
.margin-auto { margin-left: auto; margin-right: auto; }
.text-gold { color: var(--secondary-color) !important; }
.text-blue { color: var(--primary-color) !important; }
.font-bold { font-weight: 700; }
.font-black { font-weight: 900; }

.section-header {
    text-align: center;
    max-width: 700px;
    margin: 0 auto 3.5rem;
}

.section-header p {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-top: 0.5rem;
}

/* Tab buttons for sub-sections */
.tabs-container {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 3rem;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 0.6rem 1.5rem;
    border-radius: 50px;
    font-weight: 700;
    border: 1px solid var(--border-color);
    cursor: pointer;
    background-color: var(--bg-card);
    transition: all var(--transition-fast);
}

.tab-btn.active, .tab-btn:hover {
    background-color: var(--primary-color);
    color: #ffffff;
    border-color: var(--primary-color);
}

/* Responsive Maps & Video */
.responsive-iframe {
    width: 100%;
    height: 350px;
    border-radius: 16px;
    border: none;
    box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   RELIGIOUS BACKGROUND IMAGES & BANNER STYLING
   ========================================================================== */

.hero {
    background-image: url('images/E2.jpeg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
}

.temple-banner {
    background-image: linear-gradient(135deg, rgba(13, 71, 161, 0.9), rgba(15, 23, 42, 0.95)), url('images/I2.jpeg') !important;
    background-size: cover !important;
    background-position: center !important;
    background-repeat: no-repeat !important;
}

/* Common Page Banner Header */
.page-banner {
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-attachment: fixed;
    position: relative;
    padding: 7rem 0;
    text-align: center;
    color: #ffffff;
    margin-bottom: 2rem;
}

.page-banner::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(13, 71, 161, 0.85), rgba(15, 23, 42, 0.9));
    z-index: 1;
}

.page-banner-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.page-banner-content h1 {
    font-size: 3rem;
    font-weight: 900;
    color: #ffffff;
    text-shadow: 0 4px 8px rgba(0,0,0,0.3);
    margin-bottom: 0.5rem;
}

.page-banner-content p {
    color: var(--secondary-color);
    font-size: 1.2rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* Individual page banner backgrounds */
.banner-about { background-image: url('images/I3.jpeg'); }
.banner-apotre { background-image: url('images/eveque.jpeg'); }
.banner-ministeres { background-image: url('images/I5.jpeg'); }
.banner-tv { background-image: url('images/I6.jpeg'); }
.banner-evenements { background-image: url('images/I7.jpeg'); }
.banner-bibliotheque { background-image: url('images/I8.jpeg'); }
.banner-boutique { background-image: url('images/I9.jpeg'); }
.banner-don { background-image: url('images/I10.jpeg'); }
.banner-priere { background-image: url('images/I11.jpeg'); }
.banner-contact { background-image: url('images/I12.jpeg'); }

/* Mobile Menu Dropdowns Override */
@media (max-width: 1024px) {
    .nav-dropdown {
        position: static;
        transform: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        box-shadow: none;
        border: none;
        background-color: rgba(13, 71, 161, 0.05);
        min-width: 100%;
        padding: 0.5rem 0 0.5rem 1rem;
        margin-top: 0.5rem;
        border-radius: 8px;
    }
    .nav-item {
        width: 100%;
    }
    .nav-item:hover .nav-dropdown {
        transform: none;
    }
    .dropdown-link {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    .dropdown-link:hover {
        padding-left: 1.25rem;
    }
    
    /* Disabling fixed background attachment on mobile for performance and rendering bugs */
    .hero, .page-banner {
        background-attachment: scroll !important;
    }
}

/* Additional Mobile Responsiveness Fixes */
@media (max-width: 768px) {
    .page-banner {
        padding: 4rem 0;
    }
    .page-banner-content h1 {
        font-size: 2rem;
    }
    .page-banner-content p {
        font-size: 0.95rem;
    }
}

@media (max-width: 480px) {
    :root {
        --header-height: 70px;
    }
    .logo-title {
        font-size: 1.1rem;
    }
    .logo-subtitle {
        font-size: 0.55rem;
        letter-spacing: 1px;
    }
    .logo-img {
        width: 35px;
        height: 35px;
    }
    .header-container {
        padding: 0 0.75rem;
    }
    .action-buttons {
        gap: 0.35rem;
    }
    .action-buttons #lang-toggle-btn {
        padding: 0.35rem 0.65rem;
        font-size: 0.75rem;
    }
    .btn-icon {
        width: 34px;
        height: 34px;
    }
    
    /* Cart Drawer full width on mobile */
    .cart-drawer {
        width: 100% !important;
        max-width: 100vw !important;
        right: -100%;
    }
    .cart-drawer.open {
        right: 0;
    }
}

@media (max-width: 400px) {
    /* Chatbot Panel responsive layout */
    .bot-panel {
        width: calc(100vw - 2rem) !important;
        right: 1rem !important;
        bottom: 5rem !important;
    }
}

/* General Responsive Table Utility */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Pastoral Couple Gallery Grid Responsive Styles */
@media (max-width: 900px) {
    .pastoral-couple-gallery {
        grid-template-columns: repeat(3, 1fr) !important;
    }
}
@media (max-width: 600px) {
    .pastoral-couple-gallery {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}
@media (max-width: 400px) {
    .pastoral-couple-gallery {
        grid-template-columns: 1fr !important;
    }
}

/* Mobile settings drawer stylesheet configuration */
.mobile-settings-drawer {
    display: none;
    padding: 1.5rem 0;
    margin-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    gap: 1rem;
    align-items: center;
    width: 100%;
}

@media (max-width: 1024px) {
    /* Hide theme toggle and cart from header bar — they go into the mobile drawer */
    .header-container #theme-toggle-btn {
        display: none !important;
    }

    /* Keep language toggle visible but very compact */
    .header-container #lang-toggle-btn {
        padding: 0.3rem 0.6rem !important;
        font-size: 0.7rem !important;
        min-width: auto !important;
        border-width: 1.5px !important;
    }

    /* Hide cart button from header on mobile — accessible via drawer */
    .action-buttons .btn-primary.btn-icon {
        display: none !important;
    }

    /* Shrink action-buttons container to avoid logo overlap */
    .action-buttons {
        gap: 0.4rem !important;
        margin-left: 0 !important;
    }

    /* Display settings inside mobile slide-out navbar drawer */
    .mobile-settings-drawer {
        display: flex;
    }
}
