/* =========================================
   1. VARIABLES & RESET
   ========================================= */
:root {
    --pak-green: #004225;
    --deep-green: #002b18;
    --gold: #D4AF37;
    --light-gold: #f3e5ab;
    --cream: #F5F5F0;
    --text: #333;
    --white: #ffffff;
    --shadow: 0 10px 30px rgba(0,0,0,0.15);
}

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

body {
    font-family: 'Montserrat', sans-serif;
    background-color: var(--cream);
    color: var(--text);
    overflow-x: hidden;
    line-height: 1.6;
}

h1, h2, h3 { font-family: 'Playfair Display', serif; }

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

.hidden { display: none !important; }

/* =========================================
   2. NAVIGATION (Lang Switch & Pill Menu)
   ========================================= */
/* Language Toggle */
.lang-switch {
    position: fixed;
    top: 30px;
    left: 30px;
    background: rgba(0, 66, 37, 0.95);
    padding: 10px 20px;
    border-radius: 30px;
    z-index: 1001;
    display: flex;
    gap: 10px;
    align-items: center;
    border: 2px solid var(--gold);
    box-shadow: 0 5px 15px rgba(0,0,0,0.3);
    color: white;
    backdrop-filter: blur(5px);
    font-weight: 600;
    font-size: 0.9rem;
}

.lang-btn { cursor: pointer; opacity: 0.6; transition: 0.3s; }
.lang-btn:hover, .lang-btn.active { opacity: 1; color: var(--gold); }
.lang-btn.active { text-decoration: underline; text-underline-offset: 4px; }
.divider { color: rgba(255,255,255,0.3); }

/* Morphing Pill Menu */
.pill-menu {
    position: fixed;
    top: 30px;
    right: 30px;
    background: var(--pak-green);
    border-radius: 50px;
    height: 60px;
    width: 125px; 
    display: flex;
    align-items: center;
    padding: 0 15px;
    z-index: 1000;
    border: 2px solid var(--gold);
    box-shadow: 0 10px 25px rgba(0, 66, 37, 0.3);
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.pill-menu.active { width: 750px; background: var(--deep-green); }

.pill-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    color: var(--gold);
    flex-shrink: 0;
}

.menu-label { font-weight: 600; font-size: 0.9rem; letter-spacing: 1px; }
.pill-menu.active .menu-label { display: none; }

.hamburger-icon { display: flex; flex-direction: column; gap: 5px; }
.hamburger-icon span { width: 20px; height: 2px; background-color: var(--gold); transition: all 0.3s; }
.pill-menu.active .hamburger-icon span:first-child { transform: rotate(45deg) translate(3px, 3px); }
.pill-menu.active .hamburger-icon span:last-child { transform: rotate(-45deg) translate(2px, -2px); }

/* Menu Links */
.pill-links {
    display: flex;
    align-items: center;
    width: 0; opacity: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: all 0.4s ease;
    gap: 25px;
    justify-content: space-evenly;
}

.pill-menu.active .pill-links { width: 100%; opacity: 1; margin-left: 20px; pointer-events: auto; }

.pill-links a {
    color: white; text-decoration: none;
    font-size: 0.9rem; font-weight: 500; transition: 0.3s;
}
.pill-links a:hover { color: var(--gold); }

/* =========================================
   3. HERO SECTION
   ========================================= */
header {
    height: 100vh;
    position: relative;
    background: url('assets/hero_bg.jpg') center/cover no-repeat fixed;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: white;
}

.hero-overlay {
    position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(0, 66, 37, 0.8), rgba(0, 66, 37, 0.5));
}

.hero-content { position: relative; z-index: 1; padding: 20px; }
.hero-motif {
    width: 80px; height: 80px;
    border: 2px solid var(--gold);
    transform: rotate(45deg);
    margin: 0 auto 30px;
    display: flex; align-items: center; justify-content: center;
}
.hero-motif i { transform: rotate(-45deg); font-size: 2rem; color: var(--gold); }

header h1 { font-size: 4rem; margin-bottom: 10px; opacity: 0; animation: fadeUp 1s forwards 0.5s; }
header p { font-size: 1.2rem; color: var(--light-gold); opacity: 0; animation: fadeUp 1s forwards 0.8s; }

/* =========================================
   4. EID CARD (Classy & Shiny)
   ========================================= */
#eid-card {
    margin: 10px auto 30px auto;
    width: 95%; max-width: 500px;
    position: relative; overflow: hidden;
    border-radius: 15px; z-index: 10;
}

.eid-glass-wrapper {
    background: linear-gradient(135deg, rgba(0, 66, 37, 0.95) 0%, rgba(0, 43, 24, 1) 100%);
    border: 1.5px solid #D4AF37;
    padding: 20px;
    border-radius: 15px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    text-align: center;
}

/* Shimmer Animation */
.eid-shimmer {
    position: absolute; top: 0; left: -150%;
    width: 60%; height: 100%;
    background: linear-gradient(to right, transparent 0%, rgba(255, 255, 255, 0.08) 50%, transparent 100%);
    transform: skewX(-20deg);
    animation: shine 5s infinite;
}

#eid-title {
    color: #D4AF37; font-size: 1.8rem; margin-bottom: 5px;
    text-transform: uppercase; letter-spacing: 1px;
}

.eid-main-info {
    display: flex; justify-content: center; align-items: baseline;
    gap: 10px; margin-bottom: 5px;
}

#eid-label { color: rgba(255,255,255,0.9); font-size: 1rem; }
.eid-subtext { color: rgba(255, 255, 255, 0.7); font-size: 0.85rem; font-style: italic; }

/* Date | Time Layout */
#eid-time-value {
    color: #D4AF37; font-size: 1.8rem; font-weight: 700;
    display: block; margin-top: 5px;
}
.eid-date { color: #ffffff; font-size: 1.2rem; font-weight: 500; }
.eid-separator { color: #D4AF37; opacity: 0.5; margin: 0 8px; font-weight: 300; }

/* =========================================
   5. TIMETABLE & SECTIONS
   ========================================= */
section {
    padding: 100px 0;
    position: relative;
    opacity: 0; transform: translateY(50px);
    transition: all 0.8s ease-out;
}

.section-title { font-size: 2.5rem; color: var(--pak-green); margin-bottom: 60px; text-align: center; }
.section-title::after { content: ''; display: block; width: 60px; height: 3px; background: var(--gold); margin: 15px auto 0; }

/* About */
#about { background-color: white; text-align: center; }
.about-text-centered { max-width: 800px; margin: 0 auto; }
.lead-text { font-size: 1.2rem; font-weight: 600; color: var(--pak-green); margin-bottom: 25px; }
.status-box {
    display: inline-block; background: #f4f4f4;
    padding: 15px 30px; border-radius: 50px;
    border: 2px solid var(--gold); color: var(--pak-green);
}

/* Timetable */
#timetable { background-color: #f9f9f9; padding: 80px 0; }
.calendar-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 25px; flex-wrap: wrap; gap: 20px; }
.month-subtitle { font-size: 1.1rem; color: var(--pak-green); font-weight: 600; }

.header-actions { display: flex; gap: 15px; align-items: center; flex-wrap: wrap; }
.jummah-badge {
    background: var(--pak-green); color: var(--gold);
    padding: 10px 20px; border-radius: 8px; font-weight: bold;
    display: flex; align-items: center; gap: 10px;
}
.btn-pdf, .btn-ramadan-pdf {
    background: var(--gold); color: var(--pak-green);
    padding: 10px 20px; border-radius: 8px; font-weight: bold;
    cursor: pointer; transition: 0.2s; border: none; display: flex; align-items: center; gap: 8px;
}
.btn-pdf:hover, .btn-ramadan-pdf:hover { background: #b5952f; transform: translateY(-2px); }

/* Table */
.table-wrapper { background: white; border-radius: 12px; box-shadow: 0 5px 20px rgba(0,0,0,0.05); overflow-x: auto; margin-bottom: 30px; }
.prayer-table { width: 100%; border-collapse: collapse; text-align: center; min-width: 800px; }
.prayer-table th { background: var(--pak-green); color: white; padding: 18px; text-transform: uppercase; font-size: 0.95rem; }
.prayer-table td { padding: 15px; border-bottom: 1px solid #eee; font-size: 0.95rem; }

.row-today { background-color: rgba(212, 175, 55, 0.15) !important; }
.row-today td:first-child { border-left: 5px solid var(--gold); }
.row-today td { color: var(--pak-green); font-weight: 700; }

/* =========================================
   6. DONATE SECTION (Fixed & Clean)
   ========================================= */
#donate {
    background-color: white;
    padding: 80px 0;
}

.bank-card-container {
    display: flex;
    justify-content: center;
    padding: 10px;
    margin-top: 20px;
}

/* The Card Itself */
.modern-bank-card {
    background: linear-gradient(135deg, #004225 0%, #002b18 100%);
    width: 100%;
    max-width: 480px;
    border-radius: 20px;
    padding: 30px;
    color: white;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3); /* Deep shadow for depth */
    border: 1px solid rgba(212, 175, 55, 0.4); /* Gold Border */
    position: relative;
    overflow: hidden;
    font-family: 'Montserrat', sans-serif; /* Ensures clean text everywhere */
}

/* Shine Animation */
.card-shine {
    position: absolute; top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(125deg, rgba(255,255,255,0) 30%, rgba(255,255,255,0.05) 40%, rgba(255,255,255,0) 50%);
    pointer-events: none;
}

/* Header Row */
.card-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 25px; opacity: 0.9;
}

.bank-brand {
    display: flex; align-items: center; gap: 10px;
    font-size: 0.85rem; color: var(--gold);
    font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px;
}

.contactless-icon {
    font-size: 1.8rem;
    color: rgba(255,255,255,0.3);
    transform: rotate(90deg);
}

/* Labels */
.card-label {
    display: block; font-size: 0.65rem; color: rgba(255,255,255,0.5);
    text-transform: uppercase; letter-spacing: 1px; margin-bottom: 6px;
    font-weight: 600;
}

/* --- THE COPYABLE FIELDS (Dark Boxes) --- */
.data-row-copy {
    display: flex; align-items: center; justify-content: space-between;
    background: rgba(0, 0, 0, 0.25); /* Dark background makes text pop */
    padding: 12px 15px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

/* Hover Effect: Gold Border */
.data-row-copy:hover {
    background: rgba(0, 0, 0, 0.35);
    border-color: var(--gold);
    transform: translateY(-1px);
}

.data-row-copy:active { transform: scale(0.98); }

/* IBAN Text - CRITICAL FIX */
.iban-digits { 
    font-family: 'Montserrat', monospace; /* Monospace makes numbers align perfectly */
    font-size: 1.35rem; 
    font-weight: 600; 
    letter-spacing: 2px; 
    color: #fff;
    white-space: nowrap;
}

/* Copy Icon styling */
.copy-feedback {
    display: flex; align-items: center; justify-content: center;
    color: var(--gold);
    width: 24px; height: 24px;
}
.copy-feedback i { font-size: 1.1rem; }

/* --- BOTTOM GRID --- */
.value-text {
    font-size: 0.85rem; 
    font-weight: 500; 
    color: rgba(255,255,255,0.95);
    
    /* ALLOW WRAPPING */
    white-space: normal;  /* Allows text to go to next line */
    overflow: visible;    /* Removes the cut-off */
    text-overflow: clip;  /* Removes the "..." */
    
    /* Typography for multi-line */
    line-height: 1.3;     /* Tighter spacing for 2 lines */
    word-break: break-word; /* Prevents long words from breaking layout */
    display: block;
}

.grid-item {
    /* Allow the box to grow vertically */
    min-width: 0; 
    display: flex;
    flex-direction: column;
    justify-content: flex-end; /* Aligns content to bottom if heights differ */
}

/* Ensure the Grid aligns items properly when one is taller */
.card-grid {
    display: grid;
    grid-template-columns: 65% 30%; /* Keeps the width ratio */
    justify-content: space-between;
    gap: 0;
    margin-top: 25px;
    align-items: end; /* Aligns BIC to the bottom to match the multi-line name */
}

.grid-item.full-width {
    grid-column: 1 / -1; /* Spans full width */
    margin-top: 15px;
    width: 100%;
}

.data-row-copy {
    display: flex; 
    align-items: center; 
    justify-content: space-between; /* Pushes Text left, Icon right */
    background: rgba(0, 0, 0, 0.25);
    padding: 12px 15px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
    width: 100%; /* Ensure it fits container */
    gap: 10px; /* Space between text and icon */
}

/* Fix for Reference Text: Make it shrink if needed */
.data-row-copy span {
    flex: 1; /* Takes up all available space */
    min-width: 0; /* Allows shrinking */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Fix for Icon: NEVER shrink */
.copy-feedback {
    flex-shrink: 0; /* Prevents icon from being squished or pushed out */
    display: flex; 
    align-items: center; 
    justify-content: center;
    color: var(--gold);
    width: 24px; 
    height: 24px;
}

/* Reference Box Specifics */
.small-copy .iban-digits, 
.small-copy span {
    font-family: 'Montserrat', sans-serif;
    font-size: 1rem; 
    color: var(--gold); 
    font-weight: 600; 
    letter-spacing: 1px;
}
.small-copy { padding: 10px 15px; }

/* Mobile Adjustments */
@media (max-width: 480px) {
    .modern-bank-card { padding: 20px; }
    .iban-digits { font-size: 1rem; letter-spacing: 1px; }
    .bank-brand { font-size: 0.75rem; }
    .card-grid { gap: 15px; }
}

/* =========================================
   7. FOOTER
   ========================================= */
#location { 
    height: 450px; /* Increased height slightly for better view */
    padding: 0;    /* CRITICAL: Removes the 100px padding shrinking the map */
    width: 100%;
    filter: grayscale(100%); 
    transition: 0.5s;
    position: relative;
}

#location:hover { 
    filter: grayscale(0%); 
}

#location iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block; /* Removes any default inline spacing */
}

footer { background: var(--deep-green); color: rgba(255,255,255,0.6); padding: 40px; text-align: center; }
.footer-legal a { color: var(--gold); text-decoration: none; margin: 0 10px; transition: opacity 0.3s; }
.footer-legal a:hover { opacity: 0.7; }

/* =========================================
   8. Notification System (Ticker)
   ========================================= */

.notif-ticker {
    width: 100%;
    background: var(--gold);
    color: var(--pak-green);
    overflow: hidden;
    white-space: nowrap;
    height: 35px; /* Slightly slimmer for a more integrated look */
    display: flex;
    align-items: center;
    position: fixed; 
    top: 0;
    left: 0;
    z-index: 10001;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.notif-ticker.hidden {
    display: none !important;
}

.ticker-wrapper {
    width: 100%;
    overflow: hidden;
}

.ticker-items {
    display: inline-block;
    padding-left: 100%; 
    animation: marquee-scroll 25s linear infinite; /* Slightly faster for short notices */
}

.ticker-items:hover {
    animation-play-state: paused; /* Allows users to stop and read on hover */
}

.ticker-item {
    display: inline-block;
    padding-right: 80px; 
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.bullet {
    margin-right: 15px;
    opacity: 0.4;
}

@keyframes marquee-scroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); }
}

/* Push layout down when active */
body.has-notif {
    margin-top: 35px !important;
}

/* Move the fixed elements down without breaking their animations */
body.has-notif .lang-switch,
body.has-notif .pill-menu {
    /* Instead of changing 'top', we shift the whole element down 35px */
    transform: translateY(35px);
    /* We must include the existing transitions to keep them smooth */
    transition: transform 0.4s ease, width 0.5s cubic-bezier(0.4, 0, 0.2, 1), background 0.5s ease;
}

/* Ensure the hero section doesn't get cut off */
body.has-notif header {
    height: calc(100vh - 35px);
}

@keyframes shine { 0% { left: -150%; } 20% { left: 150%; } 100% { left: 150%; } }
@keyframes fadeUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

/* Special Day Styling */
.highlight-event {
    background-color: rgba(212, 175, 55, 0.08) !important; /* Soft Gold tint */
    border-left: 3px solid #D4AF37; /* Gold accent line to differentiate */
}

.event-badge {
    display: flex;
    flex-direction: column;
    margin-bottom: 5px;
    line-height: 1.2;
}

.arabic-small {
    font-family: 'Montserrat', sans-serif; /* Use your preferred Arabic-supporting font */
    font-size: 0.75rem;
    color: #854d0e; /* Deep Gold/Brown */
    font-weight: 600;
}

.de-label {
    font-size: 0.65rem;
    font-weight: 600;
    color: #004225;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Row Styling */
.row-today {
    background-color: rgba(0, 66, 37, 0.05) !important;
    font-weight: bold;
}

/* =========================================
   8. MOBILE RESPONSIVE
   ========================================= */
@media (max-width: 768px) {
    header h1 { font-size: 2.2rem; }
    .lang-switch { top: 20px; left: 20px; padding: 8px 12px; font-size: 0.75rem; }
    
    .pill-menu { top: 20px; right: 50%; transform: translateX(50%); width: 130px; }
    .pill-menu.active { width: 95%; justify-content: flex-start; }
    .pill-menu.active .menu-label { display: none; }
    .pill-menu.active .pill-links { width: 100%; margin-left: 10px; gap: 10px; justify-content: space-around; }
    .pill-links a { font-size: 0.75rem; }

    .header-actions { justify-content: center; width: 100%; }
    .btn-pdf, .btn-ramadan-pdf, .jummah-badge { width: 100%; justify-content: center; }
    body.has-notif .pill-menu {
        transform: translate(50%, 35px) !important;
    }
}