/* * themes.css - Optimized Full Version (V 4.8)
 * Logic: Atomic Design + Premium Card Gradients + SVG Native Icons + Desktop Balance
 * Updated: Added SaleemQuran Registration & Arabic Class Fix
 */

/* --- 0. FONT REGISTRATION --- */
@font-face {
    font-family: 'SaleemQuran';
    src: url('../fonts/saleem-quran.woff2') format('woff2');
    font-display: swap;
}

@font-face {
    font-family: 'Mehr';
    src: url('../fonts/mehr.woff2') format('woff2');
    font-display: swap;
}

/* --- 1. GLOBAL VARIABLES --- */
:root {
    --primary-accent: #064e3b;
    --primary-soft: color-mix(in srgb, var(--primary-accent), white 95%);
    --card-bg: #ffffff;
    --body-bg: color-mix(in srgb, var(--primary-accent) 8%, #ffffff);
    --text-main: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --sidebar-width: 260px;
    --header-height: 64px;
    --radius-lg: 1.5rem;
    --radius-xl: 3.5rem;
}

/* --- 2. DARK MODE OVERRIDES --- */
.dark-mode {
    --body-bg: #0f172a;
    --card-bg: #1e293b;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --border-color: #334155;
}

.dark-mode .bg-white, .dark-mode .card-white {
    background-color: var(--card-bg) !important;
    color: var(--text-main) !important;
}

/* --- 3. UNIFIED LAYOUT & SCROLL FIX --- */
html, body {
    /* اسکرول بار فکس: ہائٹ کو آٹو رکھیں تاکہ مواد کے مطابق اسکرول ظاہر ہو */
    height: auto !important; 
    min-height: 100% !important;
    margin: 0;
    padding: 0;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-family: 'Mehr', 'SaleemQuran', system-ui, -apple-system, sans-serif;
    background-color: var(--body-bg) !important;
    color: var(--text-main);
    overflow-x: hidden !important; 
    overflow-y: auto !important; /* عمودی اسکرول کو زبردستی فعال کیا گیا ہے */
}

.wrapper {
    display: flex;
    min-height: 100vh;
    width: 100%;
    position: relative;
    background-color: var(--body-bg) !important;
    align-items: stretch;
    overflow: visible !important;
}

.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    position: relative;
    background-color: var(--body-bg) !important;
    contain: layout style;
    overflow-y: visible !important;
}

/* --- 4. NAVIGATION & SIDEBAR --- */
#main-site-header, .theme-social-bar { 
    position: sticky !important; 
    top: 0; 
    z-index: 1000; 
    height: var(--header-height);
    background-color: var(--primary-accent) !important;
    display: flex;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateZ(0); 
    width: 100%;
    will-change: transform;
}

#main-site-header *, .theme-social-bar * {
    color: #ffffff !important;
    fill: #ffffff !important;
    stroke: #ffffff !important;
}

.sidebar-area, aside {
    position: fixed; 
    top: 0; 
    right: 0; 
    height: 100vh;
    width: var(--sidebar-width);
    background-color: var(--card-bg) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-left: 1px solid var(--border-color) !important;
    border-right: none;
    overflow-y: auto; 
    z-index: 1100; 
    scrollbar-width: none;
    box-sizing: border-box;
    transition: background-color 0.3s ease, border-color 0.3s ease;
    contain: strict;
}

.sidebar-area::-webkit-scrollbar { display: none; }

@media (min-width: 1025px) {
    .sidebar-area a {
        margin: 0.4rem 1rem;
        border-radius: 1rem;
        padding: 1.1rem 1.25rem; 
        font-size: 1.3rem; 
        font-weight: 700;
        display: flex; 
        align-items: center; 
        transition: 0.2s;
        color: var(--text-main);
    }
    .sidebar-area a:hover, .sidebar-area a.active {
        background: var(--primary-accent) !important; 
        color: #ffffff !important;
        transform: translateX(-5px);
    }
    .sidebar-area a svg { margin-left: 10px; stroke: var(--primary-accent); }
    .sidebar-area a:hover svg, .sidebar-area a.active svg { stroke: #ffffff; }
    
    .content-area {
        margin-right: var(--sidebar-width) !important;
        width: calc(100% - var(--sidebar-width));
    }
    
    .theme-social-bar {
        backdrop-filter: blur(8px);
        -webkit-backdrop-filter: blur(8px);
        background-color: color-mix(in srgb, var(--primary-accent), transparent 10%) !important;
    }
}

/* --- 5. TEXT & CARD PERFORMANCE --- */
.urdu-text, [lang="ur"] { 
    font-family: 'Mehr', serif !important; 
    line-height: 1.8 !important;
    text-rendering: optimizeLegibility;
}

/* عربی کے لیے مخصوص کلاس */
.font-arabic, .arabic-text { 
    font-family: 'SaleemQuran', 'AmiriQuran', serif !important; 
    direction: rtl !important; 
    unicode-bidi: isolate;
}

/* کوٹیشن کے رنگوں کا فکس (Light & Dark Mode) */
.quote-container blockquote {
    color: var(--text-main) !important;
    transition: color 0.3s ease;
}

.dark-mode .quote-container blockquote {
    color: #ffffff !important; /* ڈارک موڈ میں خالص سفید */
}

.dark-mode .quote-container cite {
    color: #fbbf24 !important; /* ڈارک موڈ میں سنہرا رنگ (Amber) */
}

.prayer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    contain: layout style paint; 
    content-visibility: auto;
    contain-intrinsic-size: 1px 500px;
    min-height: 250px;
}

.prayer-card, .dua-card { 
    min-height: 90px; 
    height: auto;
    content-visibility: auto; 
    contain-intrinsic-size: 1px 150px;
    contain: content;
  
    transition: transform 0.2s ease-out, box-shadow 0.2s ease;
    border: 1px solid rgba(255, 255, 255, 0.15); 
    position: relative; 
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    box-shadow: 0 15px 35px -5px rgba(0, 0, 0, 0.2); 
    text-rendering: optimizeLegibility;
    will-change: transform;
}

.prayer-card::after {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(rgba(255,255,255,0.1), transparent);
    pointer-events: none;
}

.prayer-card div { line-height: 1.1 !important; min-height: 1.2em; }

@media (min-width: 1025px) {
    .prayer-card {
        min-height: 110px !important;
        padding: 1rem 1.25rem !important;
        border-radius: 2.5rem !important;
        margin-bottom: 0.7rem;
    }
    .prayer-card h3 { font-size: 1.6rem !important; margin-bottom: 0 !important; }
    .prayer-card div { font-size: 3.8rem !important; }
    .prayer-card svg { width: 24px !important; height: 24px !important; margin-bottom: 4px !important; }
}

.prayer-card:hover { 
    transform: translateY(-8px) scale(1.01); 
    filter: brightness(1.1); 
    cursor: default; 
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.4); 
}
/* --- 6. CARD GRADIENTS --- */
html:not(.dark-mode) .card-sahar     { background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%) !important; }
html:not(.dark-mode) .card-fajar     { background: linear-gradient(135deg, #312e81 0%, #4338ca 100%) !important; }
html:not(.dark-mode) .card-sunrise   { background: linear-gradient(135deg, #b45309, #f59e0b) !important; }
html:not(.dark-mode) .card-zohrain   { background: linear-gradient(135deg, #92400e 0%, #d97706 100%) !important; }
html:not(.dark-mode) .card-sunset    { background: linear-gradient(135deg, #475569, #64748b) !important; }
html:not(.dark-mode) .card-maghrbain { background: linear-gradient(135deg, #4c1d95 0%, #6d28d9 100%) !important; }
html:not(.dark-mode) .card-aftar     { background: linear-gradient(135deg, #7c2d12 0%, #ea580c 100%) !important; }

.dark-mode .prayer-card {
    background: rgba(30, 41, 59, 0.8) !important; 
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.5) !important;
}
.dark-mode .prayer-card h3 { color: var(--text-main) !important; }
.dark-mode .prayer-card svg { stroke: var(--primary-accent) !important; opacity: 1 !important; }

/* Ramadan Glows */
.dark-mode .card-sahar { border-color: rgba(59, 130, 246, 0.4) !important; box-shadow: 0 0 30px rgba(59, 130, 246, 0.15) !important; }
.dark-mode .card-sahar svg, .dark-mode .card-sahar h3 { color: #60a5fa !important; stroke: #60a5fa !important; }
.dark-mode .card-aftar { border-color: rgba(234, 88, 12, 0.4) !important; box-shadow: 0 0 30px rgba(234, 88, 12, 0.15) !important; }
.dark-mode .card-aftar svg, .dark-mode .card-aftar h3 { color: #fb923c !important; stroke: #fb923c !important; }

/* --- 7. LUNAR TABLE --- */
.lunar-table { 
    width: 100%; border-collapse: separate; border-spacing: 0; 
    background: var(--card-bg); border-radius: 12px; overflow: hidden; 
}
.lunar-table thead th { background-color: var(--primary-accent); color: #fff; padding: 1.25rem; font-size: 1.5rem; }
.lunar-table td { padding: 1rem; border-bottom: 1px solid var(--border-color); font-size: 1.4rem; vertical-align: middle; }

.col-sahar   { color: #b45309 !important; font-weight: 800; }
.col-fajar   { color: #0369a1 !important; font-weight: 800; }
.col-zohrain { color: #15803d !important; font-weight: 800; }
.col-maghrib { color: #7e22ce !important; font-weight: 800; }
.col-aftar   { color: #1d4ed8 !important; font-weight: 800; }

.dark-mode .col-sahar   { color: #fbbf24 !important; }
.dark-mode .col-fajar   { color: #38bdf8 !important; }
.dark-mode .col-zohrain { color: #4ade80 !important; }

/* --- 8. MOBILE BOTTOM BAR & OPTIMIZATION --- */
.fixed.bottom-0 {
    background-color: color-mix(in srgb, var(--body-bg) 85%, transparent) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 2px solid var(--primary-accent);
    z-index: 50;
}

@media (max-width: 1024px) {
    .sidebar-area { display: none !important; }
    .content-area { padding-bottom: 20px !important; margin-right: 0 !important; width: 100%; }
    
    .prayer-card { 
        min-height: 85px; 
        padding: 1.25rem !important; 
        border-radius: 1.8rem !important; 
    }
    .prayer-card:hover { transform: translateY(-4px); }

    #custom-site-footer {
        margin: 1.5rem 1rem 10px 1rem !important;
        padding: 2rem 1.5rem 20px 1.5rem !important;
        border-radius: var(--radius-xl); 
        background-color: var(--card-bg); 
        text-align: center;
        width: auto !important;
    }
}

/* --- 9. NEWS TICKER --- */
.news-wrapper {  
    min-height: 48px; display: flex; flex-direction: row-reverse; 
    align-items: center; background: #000; border-radius: 0.75rem;
    overflow: hidden; direction: ltr; position: relative;
} 
.news-label {
    background: var(--primary-accent); color: #fff; padding: 0 1.5rem; 
    height: 100%; display: flex; align-items: center; font-weight: bold; 
    z-index: 20; box-shadow: -5px 0 15px rgba(0,0,0,0.3);
}
.ticker-text { display: flex; white-space: nowrap; animation: ticker-move-ltr 60s linear infinite; color: #fff; }
@keyframes ticker-move-ltr { 0% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }

/* --- 10. UTILITIES & GLASS --- */
svg { stroke-linecap: round; stroke-linejoin: round; transition: all 0.3s ease; }

.fa, .fas, .fab, .far, [class^="fa-"], [class*=" fa-"] { 
    display: none !important; 
    content: "" !important;
}

.active-today-btn { background: var(--primary-accent) !important; color: #fff !important; }

.glass-nav {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    background: rgba(255, 255, 255, 0.8);
}
.dark-mode .glass-nav { background: rgba(15, 23, 42, 0.8); }

/* --- 11. SPACING FIXES --- */
.my-6.lg\:my-8 {
    margin-top: 2rem !important; 
    margin-bottom: 1.5rem !important;  
    padding-bottom: 0 !important; 
}

@media (min-width: 1025px) {
    .my-6.lg\:my-8 { margin-bottom: 2rem !important; }
}