/* Variabel CSS untuk Font Arab Dinamis */
:root {
    --arabic-font: 'Amiri', serif;
}

/* Anti-Copy Paste Dasar (Keamanan) */
body { font-family: 'Inter', sans-serif; background-color: #111827; display: flex; justify-content: center; margin: 0; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; -ms-user-select: none; user-select: none; }
.arabic-text, textarea, input, .quran-arab { -webkit-user-select: text; -ms-user-select: text; user-select: text; }

/* Font Families */
.arabic-text, .quran-arab { direction: rtl; text-align: right; font-family: var(--arabic-font); transition: font-family 0.3s ease; }
.arabic-text { line-height: 2.2; }
.quran-arab { line-height: 2.5; }

/* App Container */
.app-container { width: 100%; max-width: 480px; background: #f9fafb; height: 100vh; height: 100dvh; position: relative; overflow: hidden; box-shadow: 0 0 25px rgba(0,0,0,0.5); display: flex; flex-direction: column; transition: background-color 0.3s; }
.dark .app-container { background: #111827; }

/* Tab & Scroll */
.tab-content { flex: 1; overflow-y: auto; overflow-x: hidden; scroll-behavior: smooth; display: none; padding-bottom: calc(75px + env(safe-area-inset-bottom)); }
.tab-content.active { display: block; }
.tab-content::-webkit-scrollbar, .view-layer-content::-webkit-scrollbar { display: none; }

/* Views (Sub-pages) */
.view-layer { position: absolute; inset: 0; background: #f9fafb; transition: transform 0.3s ease-out, background-color 0.3s; z-index: 40; transform: translateX(100%); display: flex; flex-direction: column; visibility: hidden; }
.dark .view-layer { background: #111827; }
.view-layer.active { transform: translateX(0); visibility: visible; }
.view-layer-content { flex: 1; overflow-y: auto; padding-bottom: env(safe-area-inset-bottom); }

/* Bottom Nav */
.bottom-nav { position: absolute; bottom: 0; left: 0; width: 100%; height: calc(65px + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, 0.98); backdrop-filter: blur(10px); border-top: 1px solid #f3f4f6; display: flex; justify-content: space-around; align-items: flex-start; z-index: 30; padding-bottom: env(safe-area-inset-bottom); transition: all 0.3s; }
.dark .bottom-nav { background: rgba(31, 41, 55, 0.98); border-top-color: #374151; }

.nav-item { display: flex; flex-direction: column; align-items: center; justify-content: center; width: 100%; height: 65px; color: #9ca3af; transition: all 0.2s; font-size: 10px; font-weight: 600; cursor: pointer; border: none; background: transparent; }
.dark .nav-item { color: #6b7280; }
.nav-item i { font-size: 20px; margin-bottom: 4px; transition: transform 0.2s; }
.nav-item.active { color: #dc2626; }
.dark .nav-item.active { color: #ef4444; }
.nav-item.active i { transform: translateY(-3px) scale(1.1); }

/* Gradients & Animations */
.bg-tqn-header { background: linear-gradient(180deg, #374151 0%, #111827 100%); }
.bg-tqn-icon { background: linear-gradient(135deg, #dc2626 0%, #991b1b 100%); }
.icon-hover-effect:active { transform: scale(0.92); filter: brightness(0.9); }
.maklumat-fade { transition: opacity 0.6s ease-in-out; }

/* Bottom Sheets */
.bottom-sheet-overlay { position: absolute; inset: 0; background: rgba(0,0,0,0.6); backdrop-filter: blur(2px); z-index: 50; opacity: 0; pointer-events: none; transition: opacity 0.3s; }
.bottom-sheet-overlay.active { opacity: 1; pointer-events: auto; }
.bottom-sheet { position: absolute; bottom: 0; left: 0; width: 100%; background: white; border-radius: 24px 24px 0 0; z-index: 60; transform: translateY(100%); transition: transform 0.4s ease-out, background-color 0.3s; padding-bottom: calc(env(safe-area-inset-bottom) + 15px); box-shadow: 0 -10px 40px rgba(0,0,0,0.1); }
.dark .bottom-sheet { background: #1f2937; }
.bottom-sheet.active { transform: translateY(0); }

/* Chat UI AI */
.chat-bubble-ai { background-color: #f1f5f9; color: #1f2937; border-radius: 20px 20px 20px 4px; padding: 12px 16px; font-size: 13px; max-width: 85%; margin-bottom: 16px; line-height: 1.6; border: 1px solid #e5e7eb; box-shadow: 0 2px 5px rgba(0,0,0,0.02); transition: all 0.3s; }
.dark .chat-bubble-ai { background-color: #374151; color: #f3f4f6; border-color: #4b5563; }
.chat-bubble-user { background-color: #dc2626; color: white; border-radius: 20px 20px 4px 20px; padding: 12px 16px; font-size: 13px; max-width: 85%; align-self: flex-end; margin-bottom: 16px; box-shadow: 0 4px 10px rgba(220, 38, 38, 0.2); transition: background-color 0.3s;}
.dark .chat-bubble-user { background-color: #991b1b; }
.chat-bubble-ai b { color: #b91c1c; }
.dark .chat-bubble-ai b { color: #fca5a5; }

.typing-dot { width: 6px; height: 6px; background: #9ca3af; border-radius: 50%; display: inline-block; animation: typing 1.4s infinite ease-in-out; margin: 0 2px; }
.typing-dot:nth-child(1) { animation-delay: 0s; } .typing-dot:nth-child(2) { animation-delay: 0.2s; } .typing-dot:nth-child(3) { animation-delay: 0.4s; }
@keyframes typing { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }

/* ========================================================
   GLOBAL DARK MODE OVERRIDES (The Magic Trick)
   ======================================================== */
.dark .bg-white { background-color: #1f2937 !important; }
.dark .bg-gray-50 { background-color: #111827 !important; }
.dark .bg-gray-100 { background-color: #374151 !important; }
.dark .text-gray-800, .dark .text-gray-900 { color: #f3f4f6 !important; }
.dark .text-gray-700 { color: #e5e7eb !important; }
.dark .text-gray-600 { color: #d1d5db !important; }
.dark .text-gray-500 { color: #9ca3af !important; }
.dark .border-gray-100, .dark .border-gray-200 { border-color: #374151 !important; }
.dark .border-t, .dark .border-b { border-color: #374151 !important; }
.dark input, .dark textarea { background-color: #374151 !important; color: #fff !important; border-color: #4b5563 !important; }


