/* ==========================================================================
   قۇرئانىم تورى — Zümrüt Yeşili & Altın Özel Stiller + Gece Modu + Mobil Uyum
   ========================================================================== */

/* Sülüs Logo Fontu */
@font-face {
    font-family: 'Sulus';
    src: url('../UKIJSlsTom.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}
.font-sulus { font-family: 'Sulus', serif; }

html {
    scroll-behavior: smooth;
    overflow-x: clip;
    max-width: 100%;
}

body {
    font-family: 'Lateef', 'Segoe UI', Tahoma, sans-serif;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #f5f1e7;
    color: #1f2937;
    overflow-x: clip;
    max-width: 100%;
    background-image:
        radial-gradient(rgba(6, 78, 59, 0.15) 1.5px, transparent 1.5px),
        radial-gradient(rgba(217, 119, 6, 0.15) 1.5px, transparent 1.5px);
    background-size: 32px 32px, 32px 32px;
    background-position: 0 0, 16px 16px;
}

.font-arabic { font-family: 'Amiri Quran', serif; }
.font-uyghur { font-family: 'Lateef', serif; }

.card-shadow {
    background-color: #ffffff;
    box-shadow: 0 10px 30px -10px rgba(6, 78, 59, 0.08), 0 4px 10px -4px rgba(6, 78, 59, 0.04);
    border: 1px solid #e5e0d8;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (hover: hover) {
    .card-shadow:hover {
        transform: translateY(-2px);
        box-shadow: 0 15px 40px -12px rgba(217, 119, 6, 0.15), 0 8px 15px -3px rgba(6, 78, 59, 0.1);
        border-color: rgba(217, 119, 6, 0.3);
    }
}

.search-glass {
    background: #ffffff;
    border: 1px solid #e5e0d8;
    box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.08);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.search-glass:focus-within {
    box-shadow: 0 20px 40px -10px rgba(5, 150, 105, 0.2), 0 0 0 3px rgba(5, 150, 105, 0.15);
    border-color: #059669;
}

@keyframes bookmarkBlink {
    0%, 100% { background-color: transparent; box-shadow: none; }
    50% { background-color: rgba(251, 191, 36, 0.38); box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.25); }
}
.bookmark-highlight {
    animation: bookmarkBlink 0.8s ease-in-out 2;
    border-radius: 0.5rem;
}

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #fcfaf6; }
::-webkit-scrollbar-thumb { background: #cbbca0; border-radius: 9999px; }
::-webkit-scrollbar-thumb:hover { background: #a6987f; }

/* Yüzen Bildirim (Toast) */
.toast-notice {
    position: fixed;
    left: 50%;
    bottom: calc(1.25rem + env(safe-area-inset-bottom));
    transform: translate(-50%, 1rem);
    z-index: 9998;
    padding: 0.5rem 1.25rem;
    border-radius: 1rem;
    background: rgba(2, 44, 34, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #ffffff;
    border: 1px solid rgba(217, 119, 6, 0.65);
    box-shadow: 0 20px 40px -12px rgba(0, 0, 0, 0.45);
    font-family: 'Lateef', serif;
    font-size: 1.35rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    pointer-events: none;
    white-space: nowrap;
    transition: opacity 0.28s ease, transform 0.28s ease;
}
.toast-notice.visible {
    opacity: 1;
    transform: translate(-50%, 0);
}

/* Sol Alt Sabit Yukarı Çık Butonu */
.scroll-top-btn {
    position: fixed;
    left: 1rem;
    bottom: calc(1.25rem + env(safe-area-inset-bottom));
    z-index: 55;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(6, 78, 59, 0.92);
    color: #fde68a;
    border: 1px solid rgba(251, 191, 36, 0.55);
    box-shadow: 0 10px 24px -6px rgba(2, 44, 34, 0.45);
    opacity: 0;
    transform: translateY(12px);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.2s ease, bottom 0.2s ease;
}
.scroll-top-btn.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.scroll-top-btn:hover {
    background: #022c22;
}

/* Mobil Sağ Alt Sabit Gece Modu Butonu (masaüstünde gizli) */
.mobile-theme-btn {
    display: none;
    position: fixed;
    right: 1rem;
    bottom: calc(1.25rem + env(safe-area-inset-bottom));
    z-index: 55;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    align-items: center;
    justify-content: center;
    background: rgba(6, 78, 59, 0.92);
    color: #fde68a;
    border: 1px solid rgba(251, 191, 36, 0.55);
    box-shadow: 0 10px 24px -6px rgba(2, 44, 34, 0.45);
    cursor: pointer;
    transition: transform 0.15s ease, background-color 0.2s ease, bottom 0.2s ease;
}
.mobile-theme-btn:active { transform: scale(0.94); }
.mobile-theme-btn .sun-ico { display: none; }
html.dark .mobile-theme-btn .moon-ico { display: none; }
html.dark .mobile-theme-btn .sun-ico { display: block; }
html.dark .mobile-theme-btn,
html.dark .scroll-top-btn {
    background: rgba(12, 34, 27, 0.94);
}

#pwaInstallBanner {
    bottom: calc(0.85rem + env(safe-area-inset-bottom));
}
footer {
    padding-bottom: calc(2rem + env(safe-area-inset-bottom));
}

/* ==================== GECE MODU (DARK MODE) KURALLARI ==================== */
html.dark { color-scheme: dark; }
html.dark body {
    background-color: #061410;
    color: #e5e7eb;
    background-image:
        radial-gradient(rgba(16, 185, 129, 0.12) 1.5px, transparent 1.5px),
        radial-gradient(rgba(217, 119, 6, 0.12) 1.5px, transparent 1.5px);
}
html.dark .card-shadow,
html.dark .bg-white,
html.dark .hover\:bg-white:hover,
html.dark .focus\:bg-white:focus {
    background-color: #0c221b !important;
    color: #e5e7eb;
}
html.dark .card-shadow {
    border-color: #1a3c30;
    box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.55);
}
@media (hover: hover) {
    html.dark .card-shadow:hover {
        border-color: rgba(217, 119, 6, 0.45);
        box-shadow: 0 15px 40px -12px rgba(217, 119, 6, 0.18), 0 8px 15px -3px rgba(0, 0, 0, 0.4);
    }
}
html.dark .search-glass {
    background: #0c221b;
    border-color: #1a3c30;
    box-shadow: 0 15px 35px -10px rgba(0, 0, 0, 0.5);
}
html.dark .search-glass:focus-within {
    border-color: #059669;
    box-shadow: 0 20px 40px -10px rgba(5, 150, 105, 0.25), 0 0 0 3px rgba(5, 150, 105, 0.2);
}
html.dark .bg-\[\#fcfaf6\],
html.dark .bg-\[\#fcfaf6\]\/60,
html.dark .bg-gray-50,
html.dark .hover\:bg-\[\#fcfaf6\]:hover {
    background-color: #112d24 !important;
}
html.dark .group:hover .group-hover\:bg-islamic-deep {
    background-color: #064e3b !important;
    color: #fbbf24 !important;
}
html.dark .border-\[\#e5e0d8\],
html.dark .border-gray-200 {
    border-color: #1f4739 !important;
}
html.dark .hover\:border-islamic-gold:hover,
html.dark .hover\:border-islamic-gold\/60:hover,
html.dark .hover\:border-islamic-gold\/50:hover {
    border-color: rgba(217, 119, 6, 0.65) !important;
}
html.dark .text-gray-800,
html.dark .text-gray-700,
html.dark .text-islamic-dark:not(#pwaInstallBtn) {
    color: #f3f4f6 !important;
}
html.dark .text-gray-600,
html.dark .text-gray-500,
html.dark .text-gray-400 {
    color: #9ca3af !important;
}
html.dark .text-islamic-deep,
html.dark .text-emerald-800,
html.dark .hover\:text-islamic-deep:hover {
    color: #34d399 !important;
}
html.dark .bg-emerald-50,
html.dark .bg-emerald-50\/50,
html.dark .bg-emerald-50\/90,
html.dark .hover\:bg-emerald-50:hover,
html.dark .hover\:bg-emerald-50\/70:hover {
    background-color: rgba(6, 78, 59, 0.55) !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
    color: #a7f3d0 !important;
}
html.dark .border-emerald-100 {
    border-color: rgba(16, 185, 129, 0.3) !important;
}
html.dark .bg-amber-50,
html.dark .bg-amber-50\/95,
html.dark .hover\:bg-amber-100:hover,
html.dark .hover\:bg-amber-100\/80:hover {
    background-color: rgba(120, 53, 15, 0.35) !important;
    border-color: rgba(217, 119, 6, 0.45) !important;
}
html.dark .border-amber-100,
html.dark .border-amber-200 {
    border-color: rgba(217, 119, 6, 0.4) !important;
}
html.dark .text-amber-800,
html.dark .text-amber-900,
html.dark .text-amber-950,
html.dark .text-amber-700 {
    color: #fde68a !important;
}
html.dark .bg-amber-100\/80 {
    background-color: rgba(217, 119, 6, 0.35) !important;
    color: #fef3c7 !important;
    border-color: rgba(251, 191, 36, 0.5) !important;
}
html.dark .bg-red-50,
html.dark .hover\:bg-red-50:hover,
html.dark .hover\:bg-red-100:hover {
    background-color: rgba(127, 29, 29, 0.35) !important;
    border-color: rgba(248, 113, 113, 0.4) !important;
    color: #fca5a5 !important;
}
html.dark #citySelect {
    background-image: url('data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2334d399%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E') !important;
}
html.dark select option {
    background-color: #0c221b;
    color: #f3f4f6;
}
html.dark ::-webkit-scrollbar-track { background: #061410; }
html.dark ::-webkit-scrollbar-thumb { background: #1f4739; }
html.dark ::-webkit-scrollbar-thumb:hover { background: #2d6350; }

/* ==================== YALNIZCA MOBİL EKRANLAR (<= 639px) ==================== */
@media (max-width: 639px) {
    /* 1) Üst menü: kesin 2 satır (1. satır: 3 ana buton | 2. satır: ھەدىس باغچىسى + Hicri takvim) */
    body > nav {
        padding-top: max(0.45rem, env(safe-area-inset-top)) !important;
        padding-bottom: 0.45rem !important;
    }
    body > nav > div {
        flex-direction: row !important;
        flex-wrap: wrap !important;
        justify-content: center !important;
        align-items: center !important;
        gap: 0.38rem !important;
    }
    body > nav > div > div {
        display: contents !important;
    }
    body > nav button,
    #navHadisBtn {
        height: 36px !important;
        padding-left: 0.65rem !important;
        padding-right: 0.65rem !important;
        font-size: 1.14rem !important;
    }
    #hijriDate {
        height: 36px !important;
        padding-left: 0.65rem !important;
        padding-right: 0.65rem !important;
        font-size: 1.1rem !important;
        gap: 0.35rem !important;
    }
    #themeToggleBtn {
        display: none !important;
    }
    .mobile-theme-btn {
        display: flex;
    }

    /* 2) Mobil hero & sure listesi üst boşluğu */
    #heroHeader {
        padding-top: calc(6.75rem + env(safe-area-inset-top)) !important;
        padding-bottom: 4.5rem !important;
    }
    #mainContainer.pt-44 {
        padding-top: calc(6.75rem + env(safe-area-inset-top)) !important;
    }

    /* 3) Yaklaşan Mübarek Günler: tek satır sağ-sol hizalı */
    #islamicEventsContainer > div {
        flex-wrap: nowrap !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 0.6rem !important;
        padding: 0.85rem 0.95rem !important;
    }
    #islamicEventsContainer > div > span:first-child {
        font-size: 1.2rem !important;
        line-height: 1.45 !important;
        min-width: 0;
    }
    #islamicEventsContainer > div > span:last-child {
        font-size: 1.08rem !important;
        padding: 0.25rem 0.65rem !important;
        white-space: nowrap !important;
        flex-shrink: 0 !important;
    }

    /* 4) PWA bandı açıkken köşe butonları çakışmasın */
    body.pwa-banner-open .scroll-top-btn,
    body.pwa-banner-open .mobile-theme-btn {
        bottom: calc(5.8rem + env(safe-area-inset-bottom));
    }
}

@media (max-width: 375px) {
    body > nav button,
    #navHadisBtn,
    #hijriDate {
        font-size: 1.02rem !important;
        padding-left: 0.5rem !important;
        padding-right: 0.5rem !important;
    }
    #islamicEventsContainer > div {
        padding: 0.75rem 0.75rem !important;
    }
    #islamicEventsContainer > div > span:first-child {
        font-size: 1.12rem !important;
    }
    #islamicEventsContainer > div > span:last-child {
        font-size: 1rem !important;
        padding: 0.2rem 0.5rem !important;
    }
}