/* ==========================================================================
   Islamic Portal Style — Emerald & Gold Premium Design
   ========================================================================== */

:root {
  --islam-green-primary:  #0F5132;
  --islam-green-light:    #198754;
  --islam-green-glow:     rgba(15, 81, 50, 0.1);
  --islam-gold:           #D4AF37;
  --islam-gold-light:     #F3E5AB;
  --islam-dark-bg:        #0B0F19;
  --islam-card-bg:        #ffffff;
  --islam-text:           #2D3748;
  --islam-text-muted:     #718096;
  --islam-border:         #E2E8F0;
}

/* Base Container */
.islam-portal-container {
    font-family: 'Inter', sans-serif;
    color: var(--islam-text);
    margin: 20px auto;
    width: 100%;
    min-width: min(100vw - 40px, 1200px);
    max-width: 1200px;
    padding: 0 15px;
    direction: ltr;
}

/* Header Section */
.islam-header {
    background: linear-gradient(135deg, var(--islam-green-primary), var(--islam-green-light));
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 4px 15px rgba(15, 81, 50, 0.2);
    margin-bottom: 30px;
}

.islam-header-overlay {
    padding: 60px 20px;
    text-align: center;
    color: #fff;
    background: radial-gradient(circle, rgba(0,0,0,0) 0%, rgba(0,0,0,0.3) 100%);
}

.islam-header-overlay h1 {
    font-family: 'Noto Naskh Arabic', serif;
    font-size: 2.2rem;
    margin: 0 0 10px 0;
    color: var(--islam-gold);
    text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.islam-header-overlay h2 {
    font-size: 1.4rem;
    font-weight: 500;
    margin: 0;
    opacity: 0.9;
}

/* Grid Layout */
.islam-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

/* Cards styling */
.islam-card {
    background: var(--islam-card-bg);
    border: 1px solid var(--islam-border);
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.islam-card.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(15, 81, 50, 0.1);
    border-color: var(--islam-green-light);
}

.islam-card-icon {
    font-size: 3rem;
    margin-bottom: 15px;
}

.islam-card h3 {
    font-size: 1.3rem;
    color: var(--islam-green-primary);
    margin: 0 0 10px 0;
}

.islam-card p {
    font-size: 0.95rem;
    color: var(--islam-text-muted);
    margin: 0 0 20px 0;
    line-height: 1.5;
}

.islam-btn {
    display: inline-block;
    background: var(--islam-green-primary);
    color: #fff !important;
    text-decoration: none !important;
    padding: 10px 22px;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 600;
    transition: background 0.2s ease;
    border: none;
    cursor: pointer;
}

.islam-btn:hover {
    background: var(--islam-green-light);
}

/* Quran Reader Room */
.islam-quran-header {
    background: #f7fafc;
    border: 1px solid var(--islam-border);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 25px;
}

.islam-control-panel {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: nowrap;
    gap: 8px;
    margin-top: 15px;
}

.islam-control-panel select {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid var(--islam-border);
    font-size: 0.85rem;
    max-width: 180px;
}

.font-size-adjuster {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-sm {
    padding: 5px 12px;
    border-radius: 4px;
    border: 1px solid var(--islam-border);
    background: #fff;
    cursor: pointer;
}

/* Quran Verses Row */
.islam-verse-row {
    background: #fff;
    border: 1px solid var(--islam-border);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.islam-arabic-text {
    font-family: 'Noto Naskh Arabic', serif;
    font-size: 1.8rem;
    line-height: 2.5;
    text-align: right;
    direction: rtl;
    color: var(--islam-green-primary);
    margin-bottom: 20px;
}

.islam-translation-row {
    border-top: 1px solid #edf2f7;
    padding-top: 15px;
    margin-top: 15px;
}

.islam-translation-urdu {
    font-family: 'Noto Nastaliq Urdu', serif;
    font-size: 1.25rem;
    line-height: 2.2;
    text-align: right;
    direction: rtl;
    color: #2d3748;
}

.islam-translation-english {
    font-size: 1rem;
    line-height: 1.6;
    color: #4a5568;
    margin-top: 10px;
}

.islam-verse-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--islam-text-muted);
    border-bottom: 1px solid #edf2f7;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

/* Audio Player Trigger */
.islam-audio-btn {
    background: var(--islam-gold);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: transform 0.2s ease;
}

.islam-audio-btn:hover {
    transform: scale(1.1);
}

/* Names Grid */
.islam-names-section {
    background: #f7fafc;
    border: 1px solid var(--islam-border);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
}

.islam-names-section h2 {
    color: var(--islam-green-primary);
    margin-bottom: 25px;
}

.islam-names-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 12px;
}

.islam-name-bubble {
    background: #fff;
    border: 1px solid var(--islam-border);
    border-radius: 8px;
    padding: 15px 10px;
    text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    transition: all 0.2s ease;
}

.islam-name-bubble:hover {
    border-color: var(--islam-gold);
    background: var(--islam-gold-light);
    transform: scale(1.05);
}

.islam-name-arabic {
    font-family: 'Noto Naskh Arabic', serif;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--islam-green-primary);
}

.islam-name-meaning {
    font-size: 0.75rem;
    color: var(--islam-text-muted);
    margin-top: 5px;
}

/* Prayer Times Dashboard */
.islam-prayer-dashboard {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.islam-prayer-card {
    background: #fff;
    border: 1px solid var(--islam-border);
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.islam-prayer-card h3 {
    margin-top: 0;
    color: var(--islam-green-primary);
    border-bottom: 2px solid var(--islam-green-glow);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.islam-prayer-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px dashed var(--islam-border);
}

.islam-prayer-row:last-child {
    border-bottom: none;
}

/* Compass */
.islam-compass-container {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 5px solid var(--islam-green-primary);
    margin: 30px auto;
    position: relative;
    background: radial-gradient(circle, #ffffff 0%, #f7fafc 100%);
    box-shadow: 0 4px 10px rgba(0,0,0,0.08);
}

.islam-compass-pointer {
    font-size: 4rem;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(0deg);
    transition: transform 0.2s ease-out;
}

/* Hadith Search layout */
.book-card.active-book-card {
    border-color: var(--islam-green-light) !important;
    background: var(--islam-green-glow) !important;
    box-shadow: 0 4px 15px rgba(15, 81, 50, 0.12) !important;
}

.islam-hadith-search-box {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.islam-hadith-search-box input {
    flex: 1;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid var(--islam-border);
    font-size: 1rem;
}

.hadith-card {
    background: #fff;
    border: 1px solid var(--islam-border);
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.02);
}

.hadith-arabic {
    font-family: 'Noto Naskh Arabic', serif;
    font-size: 1.4rem;
    line-height: 2.2;
    text-align: right;
    direction: rtl;
    color: var(--islam-green-primary);
    margin-bottom: 15px;
}

.hadith-translation {
    font-family: 'Noto Nastaliq Urdu', serif;
    font-size: 1.2rem;
    line-height: 2;
    text-align: right;
    direction: rtl;
    color: #2d3748;
}

.hadith-meta {
    font-size: 0.85rem;
    color: var(--islam-text-muted);
    border-top: 1px solid #edf2f7;
    padding-top: 10px;
    margin-top: 15px;
    display: flex;
    justify-content: space-between;
}

/* Post Thumb for History */
.islam-post-thumb {
    width: 100%;
    height: 180px;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
}

.islam-post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Mobile responsive */
@media (max-width: 600px) {
    .islam-header-overlay {
        padding: 40px 15px;
    }
    .islam-header-overlay h1 {
        font-size: 1.7rem;
    }
    .islam-arabic-text {
        font-size: 1.4rem;
    }
    .islam-translation-urdu {
        font-size: 1.1rem;
    }
    .islam-hadith-search-box {
        flex-direction: column;
    }
    .islam-control-panel {
        flex-wrap: wrap;
    }
}

/* Quran Interactive Word Styling */
.quran-word {
    display: inline-block;
    padding: 0 4px;
    border-radius: 4px;
    cursor: help;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.quran-word:hover {
    background-color: var(--islam-green-glow);
    color: var(--islam-green-light);
}

.quran-word-end {
    font-size: 1.3rem;
    color: var(--islam-gold);
    margin: 0 5px;
}

/* Glassmorphic Word Tooltip */
.islam-tooltip {
    position: absolute;
    display: none;
    z-index: 9999;
    background: rgba(15, 81, 50, 0.95);
    backdrop-filter: blur(8px);
    border: 1px solid var(--islam-gold);
    color: #fff;
    padding: 12px 16px;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    text-align: center;
    font-family: 'Inter', sans-serif;
    pointer-events: none;
    min-width: 140px;
    max-width: 250px;
}

.islam-tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -6px;
    border-width: 6px;
    border-style: solid;
    border-color: rgba(15, 81, 50, 0.95) transparent transparent transparent;
}

.islam-tooltip-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.7;
    margin-bottom: 4px;
}

.islam-tooltip-urdu {
    font-family: 'Noto Nastaliq Urdu', serif;
    font-size: 1.15rem;
    line-height: 1.8;
    color: var(--islam-gold-light);
}

/* Active Verse Playback Highlight */
.islam-verse-row {
    transition: background-color 0.4s ease, border-color 0.4s ease;
}

.islam-verse-row.active-audio-highlight {
    background-color: #f0fdf4; /* Very light tint of green */
    border-color: var(--islam-green-light);
    box-shadow: 0 4px 15px rgba(25, 135, 84, 0.15);
}

/* Mushaf Mode View Mode */
.islam-quran-suite.mushaf-mode-active .islam-translation-row {
    display: none !important;
}

.islam-quran-suite.mushaf-mode-active .islam-arabic-text {
    text-align: center;
    direction: rtl;
    font-size: 2.2rem; /* Larger comfortable mushaf reading font */
    line-height: 2.8;
    margin-bottom: 0;
}

.islam-quran-suite.mushaf-mode-active .islam-verse-row {
    padding: 30px 15px;
    border-bottom: 1px solid var(--islam-border);
}

.islam-control-panel label {
    font-weight: 600;
    color: var(--islam-green-primary);
}

/* ==========================================================================
   Main Portal Page Enhancements (Part 1)
   ========================================================================== */

/* Glassmorphism Panels */
.glass-panel {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(15, 81, 50, 0.05);
    padding: 25px;
    margin-bottom: 25px;
}

/* Spiritual HUD */
#islam-spiritual-hud {
    background: linear-gradient(135deg, var(--islam-green-primary), #0a3622);
    color: white;
    border: none;
    position: relative;
    overflow: hidden;
}

#islam-spiritual-hud::after {
    content: '';
    position: absolute;
    top: -50%; left: -50%; width: 200%; height: 200%;
    background: radial-gradient(circle, rgba(212, 175, 55, 0.1) 0%, rgba(0,0,0,0) 70%);
    animation: rotateAmbient 20s linear infinite;
    pointer-events: none;
}

@keyframes rotateAmbient {
    100% { transform: rotate(360deg); }
}

.hud-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 2;
}

.hijri-date-display h2 {
    color: var(--islam-gold);
    font-family: 'Noto Naskh Arabic', serif;
    margin: 5px 0 0 0;
    font-size: 1.8rem;
}

.prayer-countdown-display {
    text-align: right;
}

.pulsating-text {
    font-size: 2.5rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    animation: pulseText 2s infinite;
}

@keyframes pulseText {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

/* Daily Illumination Grid */
.islam-daily-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.daily-card {
    position: relative;
    display: flex;
    flex-direction: column;
}

.card-badge {
    position: absolute;
    top: -12px;
    left: 20px;
    background: var(--islam-gold);
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    box-shadow: 0 4px 10px rgba(212, 175, 55, 0.3);
}

.daily-card .arabic-text {
    font-family: 'Noto Naskh Arabic', serif;
    font-size: 1.5rem;
    direction: rtl;
    text-align: right;
    line-height: 2;
    margin-top: 15px;
    color: var(--islam-green-primary);
}

.daily-card .urdu-text {
    font-family: 'Noto Nastaliq Urdu', serif;
    font-size: 1.1rem;
    direction: rtl;
    text-align: right;
    line-height: 1.8;
}

.daily-card .reference {
    margin-top: auto;
    font-size: 0.85rem;
    color: var(--islam-text-muted);
    border-top: 1px dashed var(--islam-border);
    padding-top: 10px;
}

.center-content {
    text-align: center;
    justify-content: center;
    align-items: center;
}

.arabic-name-large {
    font-family: 'Noto Naskh Arabic', serif;
    font-size: 3rem;
    margin: 10px 0;
    color: var(--islam-green-primary);
}

.glow-text {
    text-shadow: 0 0 20px rgba(25, 135, 84, 0.2);
}

/* AI Semantic Search */
.search-bar-wrapper {
    display: flex;
    gap: 15px;
    margin-top: 15px;
}

#islam-ai-input {
    flex: 1;
    padding: 15px 20px;
    border-radius: 30px;
    border: 2px solid var(--islam-border);
    font-size: 1.1rem;
    transition: all 0.3s;
}

#islam-ai-input:focus {
    outline: none;
    border-color: var(--islam-green-light);
    box-shadow: 0 0 0 4px rgba(25, 135, 84, 0.1);
}

.glowing-btn {
    border-radius: 30px;
    padding: 0 30px;
    background: linear-gradient(45deg, var(--islam-green-primary), #1e9a62);
    box-shadow: 0 4px 15px rgba(25, 135, 84, 0.3);
}

.glowing-btn:hover {
    box-shadow: 0 6px 20px rgba(25, 135, 84, 0.5);
    transform: translateY(-2px);
}

/* Widgets Row */
.islam-widgets-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.widget-card h3 {
    margin-top: 0;
    color: var(--islam-green-primary);
    border-bottom: 2px solid var(--islam-border);
    padding-bottom: 10px;
    margin-bottom: 15px;
}

/* Habit Tracker */
.habit-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.habit-item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
}

.habit-item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--islam-green-primary);
    cursor: pointer;
}

.progress-container {
    margin-top: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.progress-bar-bg {
    flex: 1;
    height: 10px;
    background: #edf2f7;
    border-radius: 5px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--islam-gold);
    width: 0%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#habit-progress-text {
    font-weight: bold;
    color: var(--islam-green-primary);
}

/* Cards Navigation */
.islam-cards-navigation {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.card-of-light {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    text-decoration: none;
    padding: 30px;
    background: var(--islam-card-bg);
    border-radius: 16px;
    border: 1px solid var(--islam-border);
    color: var(--islam-text);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card-of-light::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at center, rgba(212, 175, 55, 0.05) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s;
}

.card-of-light:hover {
    transform: translateY(-5px);
    border-color: var(--islam-gold);
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.15);
}

.card-of-light:hover::before {
    opacity: 1;
}

.card-of-light .card-icon {
    font-size: 3rem;
    margin-bottom: 15px;
    z-index: 1;
}

.card-of-light h3 {
    margin: 0;
    color: var(--islam-green-primary);
    z-index: 1;
}

.card-of-light .hover-stats {
    margin-top: 10px;
    font-size: 0.85rem;
    color: var(--islam-text-muted);
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.3s;
    z-index: 1;
}

.card-of-light:hover .hover-stats {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hud-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    .prayer-countdown-display {
        text-align: center;
    }
    .search-bar-wrapper {
        flex-direction: column;
    }
}

/* ==========================================================================
   AI Dream Interpreter (Tafsir al-Ahlam) Styles
   ========================================================================== */

.dream-interpreter-container {
    background: radial-gradient(circle at top center, #0B192C 0%, #000000 100%);
    color: #e2e8f0;
    border-radius: 20px;
    padding: 40px;
    box-shadow: inset 0 0 50px rgba(0,0,0,0.5);
    position: relative;
    overflow: hidden;
}

.dream-interpreter-container::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background-image: radial-gradient(white 1px, transparent 1px);
    background-size: 50px 50px;
    opacity: 0.05;
    pointer-events: none;
}

.dream-header {
    text-align: center;
    margin-bottom: 30px;
}

.dream-header h2 {
    color: var(--islam-gold);
    font-size: 2.5rem;
    text-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
    margin-bottom: 5px;
}

.dream-header p {
    color: #94a3b8;
    font-style: italic;
}

.dream-disclaimer {
    display: flex;
    gap: 15px;
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(212, 175, 55, 0.3) !important;
    color: #cbd5e1;
}

.disclaimer-icon {
    font-size: 2rem;
}

.dream-input-section label {
    display: block;
    margin-bottom: 10px;
    color: var(--islam-gold);
    font-size: 1.1rem;
}

#islam-dream-input {
    width: 100%;
    background: rgba(255, 255, 255, 0.85); /* Light background for dark text */
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #0f172a; /* Dark text color */
    border-radius: 12px;
    padding: 15px;
    font-size: 1.1rem;
    line-height: 1.6;
    transition: all 0.3s;
    resize: vertical;
}

#islam-dream-input:focus {
    outline: none;
    border-color: var(--islam-gold);
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.4);
    background: #ffffff;
}

#islam-dream-response {
    background: rgba(255, 255, 255, 0.05) !important;
    border-top: 3px solid var(--islam-gold) !important;
    color: #f8fafc;
    line-height: 1.8;
}

#islam-dream-response h3 {
    color: var(--islam-gold);
    margin-top: 0;
}

#islam-dream-response ul {
    padding-left: 20px;
}

#islam-dream-response li {
    margin-bottom: 10px;
}

#islam-dream-btn {
    padding: 18px 25px;
    font-size: 1.2rem;
    font-weight: bold;
    border-radius: 40px;
}

/* ==========================================================================
   Quranic Flora & Fauna Styles
   ========================================================================== */
.flora-fauna-container {
    background: radial-gradient(circle at center, #0B192C 0%, #000000 100%);
    color: #e2e8f0;
    padding: 40px;
    border-radius: 20px;
}

.ff-header h2 {
    font-size: 2.5rem;
    margin-bottom: 5px;
}

.ff-filters .filter-btn {
    margin: 5px;
    border-radius: 30px;
    padding: 10px 25px;
    background: rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
}

.ff-filters .filter-btn.active, .ff-filters .filter-btn:hover {
    background: var(--islam-gold);
    color: #000;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.6);
}

.ff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    perspective: 1000px; /* Required for 3D flip */
}

.ff-item-wrapper {
    width: 100%;
    height: 380px;
    transition: all 0.5s ease;
}

/* 3D Flip Card Magic */
.ff-card {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
    cursor: pointer;
}

.ff-item-wrapper:hover .ff-card {
    transform: rotateY(180deg);
}

.ff-card-front, .ff-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 16px;
    padding: 30px 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

/* Front Side */
.ff-card-front {
    background: linear-gradient(145deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0.01) 100%);
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.ff-icon-ring {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 3px solid var(--islam-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    background: rgba(212, 175, 55, 0.1);
    box-shadow: inset 0 0 20px rgba(212, 175, 55, 0.2), 0 0 20px rgba(212, 175, 55, 0.2);
}

.ff-arabic {
    font-family: 'Noto Naskh Arabic', serif;
    font-size: 2.2rem;
    font-weight: bold;
    color: white;
}

.ff-card-front h3 {
    color: var(--islam-gold);
    margin: 0 0 5px 0;
    font-size: 1.5rem;
}

.ff-translit {
    color: #94a3b8;
    margin: 0 0 15px 0;
    font-style: italic;
}

.ff-badge {
    background: rgba(16, 185, 129, 0.2);
    color: #34d399;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.85rem;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.ff-hint {
    position: absolute;
    bottom: 15px;
    font-size: 0.8rem;
    color: #64748b;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {transform: translateY(0);}
    40% {transform: translateY(-5px);}
    60% {transform: translateY(-3px);}
}

/* Back Side */
.ff-card-back {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid var(--islam-gold);
    transform: rotateY(180deg);
    text-align: left;
    justify-content: flex-start;
    overflow-y: auto;
}

.ff-card-back h4 {
    color: var(--islam-gold);
    text-align: center;
    width: 100%;
    margin-top: 0;
    margin-bottom: 15px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    padding-bottom: 10px;
}

.ff-verse-ar {
    font-family: 'Noto Nastaliq Urdu', serif;
    font-size: 1.1rem;
    color: white;
    text-align: right;
    margin-bottom: 15px;
    line-height: 1.8;
}

.ff-verse-en {
    font-size: 0.95rem;
    color: #cbd5e1;
    font-style: italic;
    margin-bottom: 15px;
    border-left: 2px solid var(--islam-green-primary);
    padding-left: 10px;
}

.ff-wisdom {
    font-size: 0.95rem;
    color: #e2e8f0;
    background: rgba(255, 255, 255, 0.05);
    padding: 15px;
    border-radius: 8px;
    line-height: 1.6;
    margin-top: auto;
}

.ff-wisdom strong {
    color: var(--islam-gold);
}

/* ==========================================================================
   Miras Calculator Styles
   ========================================================================== */
.miras-container {
    background: linear-gradient(135deg, #020617, #0f172a);
    color: #e2e8f0;
    padding: 40px;
    border-radius: 20px;
    border: 1px solid rgba(212, 175, 55, 0.2);
}

.miras-header h2 {
    font-size: 2.5rem;
    margin-bottom: 5px;
}

.miras-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    margin-top: 30px;
}

.miras-form {
    flex: 1;
    min-width: 300px;
    padding: 25px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.miras-results {
    flex: 1.5;
    min-width: 300px;
    padding: 25px;
    background: rgba(16, 185, 129, 0.05); /* Slight green tint */
    border-radius: 16px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.miras-form h3, .miras-results h3 {
    color: white;
    margin-top: 0;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.3);
    padding-bottom: 10px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #cbd5e1;
}

.miras-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.miras-card {
    background: linear-gradient(145deg, rgba(255,255,255,0.05), rgba(255,255,255,0.01));
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
    transition: transform 0.3s;
}

.miras-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(212, 175, 55, 0.2);
}

.miras-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: rgba(212, 175, 55, 0.2);
    border: 2px solid var(--islam-gold);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px auto;
    font-size: 1.5rem;
}

.miras-card h4 {
    color: white;
    margin: 0 0 5px 0;
    font-size: 1.2rem;
}

.miras-rule {
    font-size: 0.85rem;
    color: #34d399;
    background: rgba(16, 185, 129, 0.1);
    padding: 3px 10px;
    border-radius: 12px;
    display: inline-block;
    margin-bottom: 15px;
}

.miras-amount {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--islam-gold);
}

/* ==========================================================================
   Riyadh ud-Du'a (Garden of Supplication) Styles
   ========================================================================== */
.dua-container {
    background: radial-gradient(circle at top right, #064E3B 0%, #022C22 100%);
    color: #e2e8f0;
    padding: 40px;
    border-radius: 20px;
    position: relative;
    overflow: hidden;
}

/* Background Ethereal Glows */
.dua-container::before {
    content: '';
    position: absolute;
    top: -50%; left: -50%;
    width: 200%; height: 200%;
    background: radial-gradient(circle at center, rgba(212, 175, 55, 0.05) 0%, transparent 60%);
    pointer-events: none;
}

.dua-header h2 {
    font-size: 2.5rem;
    margin-bottom: 5px;
    font-family: 'Noto Naskh Arabic', serif;
}

.dua-filter-btn {
    margin: 5px;
    border-radius: 30px;
    padding: 10px 25px;
    background: rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
}

.dua-filter-btn.active, .dua-filter-btn:hover {
    background: var(--islam-gold);
    color: #000;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.6);
}

/* Grid */
.dua-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
}

/* The Card */
.dua-card {
    background: linear-gradient(145deg, rgba(255,255,255,0.08), rgba(255,255,255,0.02));
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 16px;
    padding: 30px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.4s ease;
    backdrop-filter: blur(10px);
    position: relative;
}

.dua-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.2);
    border-color: rgba(212, 175, 55, 0.8);
}

.dua-card-title-ur {
    font-family: 'Noto Nastaliq Urdu', serif;
    font-size: 1.4rem;
    color: white;
    margin-bottom: 10px;
    line-height: 1.8;
    direction: rtl;
    text-align: center;
}

.dua-card-title-en {
    font-size: 1rem;
    color: var(--islam-gold);
}

/* The Fav Icon on Card */
.dua-card .card-fav-icon {
    position: absolute;
    top: 15px;
    right: 15px;
    font-size: 1.2rem;
    opacity: 0.5;
    transition: opacity 0.3s;
}
.dua-card.is-fav .card-fav-icon {
    opacity: 1;
    color: #ef4444; /* Red heart */
}

#dua-modal, #names-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow-y: auto;
    padding: 50px 10px;
}

/* Expanded Modal Content */
.dua-modal-content {
    background: radial-gradient(circle at bottom, #064E3B, #022C22);
    border: 1px solid var(--islam-gold);
    width: 70%;
    max-width: 1000px;
    margin: auto;
    padding: 40px;
    border-radius: 20px;
    position: relative;
}

@media (max-width: 768px) {
    .dua-modal-content {
        width: 95%;
        padding: 20px;
    }
}

.islam-modal-close {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 3rem;
    color: var(--islam-gold);
    cursor: pointer;
    line-height: 1;
    z-index: 10;
    transition: color 0.3s;
}

.islam-modal-close:hover {
    color: #ef4444;
}

.dua-modal-header {
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    padding-bottom: 20px;
    margin-bottom: 30px;
}

.dua-title-ur {
    font-family: 'Noto Nastaliq Urdu', serif;
    font-size: 2rem;
    color: white;
    margin-bottom: 5px;
    direction: rtl;
    text-align: center;
}

.dua-title-en {
    font-size: 1.2rem;
    color: var(--islam-gold);
    text-align: center;
}

.dua-text-container {
    padding: 20px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    margin-bottom: 30px;
}

.dua-text-container.export-mode,
.names-modal-content.export-mode {
    background: linear-gradient(135deg, #064e3b 0%, #047857 100%);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.5);
    margin: 0; /* Remove margin for clean export */
    border: none;
}
.dua-text-container.export-mode .export-header {
    margin-bottom: 30px;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    padding-bottom: 20px;
}
.dua-text-container.export-mode::after,
.names-modal-content.export-mode::after {
    content: 'urducoverage.local';
    display: block;
    text-align: center;
    color: rgba(255,255,255,0.7);
    font-size: 0.9rem;
    margin-top: 20px;
    font-family: 'Inter', sans-serif;
    letter-spacing: 1px;
}

.dua-arabic {
    font-family: 'Noto Naskh Arabic', serif;
    font-size: 2.5rem;
    color: white;
    line-height: 2;
    text-align: right;
    direction: rtl;
    margin-bottom: 30px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.1);
}

.dua-translation-ur {
    font-family: 'Noto Nastaliq Urdu', serif;
    font-size: 1.4rem;
    color: #e2e8f0;
    line-height: 2.2;
    text-align: right;
    direction: rtl;
    margin-bottom: 20px;
    border-right: 3px solid var(--islam-gold);
    padding-right: 15px;
}

.dua-translation-en {
    font-size: 1.1rem;
    color: #cbd5e1;
    line-height: 1.8;
    text-align: left;
    border-left: 3px solid var(--islam-green-primary);
    padding-left: 15px;
}

.dua-actions {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
}

.dua-action-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 20px;
    border-radius: 30px;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dua-action-btn:hover {
    background: rgba(212, 175, 55, 0.2);
    border-color: var(--islam-gold);
}

.dua-action-btn.active-fav {
    background: rgba(239, 68, 68, 0.2);
    border-color: #ef4444;
    color: #fca5a5;
}

.dua-views {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #94a3b8;
    padding: 10px 20px;
    font-size: 1rem;
}

/* ==========================================================================
   Virtual Hajj & Umrah Guide Styles
   ========================================================================== */
.hu-container {
    background: radial-gradient(circle at top center, #1a1a1a 0%, #000000 100%);
    color: #e2e8f0;
    padding: 40px;
    border-radius: 20px;
    border: 1px solid rgba(212, 175, 55, 0.2);
    position: relative;
    overflow: hidden;
}

/* Golden Kaaba-inspired trim at top */
.hu-container::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 6px;
    background: linear-gradient(90deg, transparent, var(--islam-gold), transparent);
}

.hu-header h2 {
    font-size: 2.5rem;
    margin-bottom: 5px;
}

.hu-toggles {
    margin-bottom: 30px;
}

.hu-toggle-btn {
    border-radius: 30px;
    padding: 10px 30px;
    background: rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
    margin: 0 10px;
    font-size: 1.1rem;
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.hu-toggle-btn.active {
    background: var(--islam-gold);
    color: #000;
    box-shadow: 0 0 20px rgba(212, 175, 55, 0.5);
    border-color: var(--islam-gold);
}

.hu-layout {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

.hu-timeline-wrapper {
    flex: 1;
    min-width: 300px;
    background: linear-gradient(145deg, rgba(20,20,20,0.8), rgba(0,0,0,0.9));
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: 30px;
    border-radius: 16px;
}

.hu-details-wrapper {
    flex: 1.5;
    min-width: 300px;
    background: linear-gradient(145deg, rgba(30,30,30,0.8), rgba(10,10,10,0.9));
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: 30px;
    border-radius: 16px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

/* Vertical Timeline */
.hu-timeline {
    position: relative;
    padding-left: 30px;
}

/* The vertical line */
.hu-timeline::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 11px;
    width: 2px;
    background: rgba(212, 175, 55, 0.2);
}

.hu-node {
    position: relative;
    margin-bottom: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 10px;
    border-radius: 8px;
}

.hu-node:hover {
    background: rgba(212, 175, 55, 0.05);
    transform: translateX(5px);
}

.hu-node.active {
    background: rgba(212, 175, 55, 0.1);
    border-left: 2px solid var(--islam-gold);
}

/* The dot */
.hu-node::before {
    content: '';
    position: absolute;
    top: 20px;
    left: -24px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #000;
    border: 2px solid var(--islam-gold);
    z-index: 1;
    transition: all 0.3s ease;
}

.hu-node.active::before {
    background: var(--islam-gold);
    box-shadow: 0 0 10px var(--islam-gold);
}

.hu-node-title-en {
    font-size: 1.1rem;
    font-weight: bold;
    color: white;
}

.hu-node-title-ur {
    font-family: 'Noto Nastaliq Urdu', serif;
    font-size: 1rem;
    color: var(--islam-gold);
    margin-top: 5px;
    direction: rtl;
    text-align: right;
}

/* Details Panel */
.hu-empty-state {
    text-align: center;
    color: #64748b;
    padding: 50px 20px;
}

.hu-detail-header {
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    padding-bottom: 20px;
    margin-bottom: 20px;
    text-align: center;
}

.hu-detail-title-en {
    font-size: 2rem;
    color: var(--islam-gold);
    margin-bottom: 10px;
}

.hu-detail-title-ur {
    font-family: 'Noto Nastaliq Urdu', serif;
    font-size: 1.8rem;
    color: white;
    direction: rtl;
}

.hu-detail-desc-en {
    font-size: 1.1rem;
    color: #cbd5e1;
    line-height: 1.6;
    margin-bottom: 15px;
}

.hu-detail-desc-ur {
    font-family: 'Noto Nastaliq Urdu', serif;
    font-size: 1.2rem;
    color: #e2e8f0;
    line-height: 2;
    direction: rtl;
    text-align: right;
    margin-bottom: 30px;
}

.hu-dua-box {
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(212, 175, 55, 0.4);
    border-radius: 12px;
    padding: 20px;
    position: relative;
}

.hu-dua-label {
    position: absolute;
    top: -12px;
    left: 20px;
    background: var(--islam-gold);
    color: #000;
    padding: 2px 10px;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: bold;
}

.hu-dua-ar {
    font-family: 'Noto Naskh Arabic', serif;
    font-size: 1.8rem;
    color: white;
    text-align: center;
    line-height: 2;
    margin-bottom: 15px;
    margin-top: 10px;
}

.hu-dua-ur {
    font-family: 'Noto Nastaliq Urdu', serif;
    font-size: 1.1rem;
    color: #cbd5e1;
    direction: rtl;
    text-align: right;
    margin-bottom: 10px;
}

.hu-dua-en {
    font-size: 0.95rem;
    color: #94a3b8;
    text-align: left;
}

/* ==========================================================================
   99 Names (Asma-ul-Husna) Styles
   ========================================================================== */
.names-container {
    background: radial-gradient(circle at center, #064E3B 0%, #022C22 100%);
    padding: 40px;
    border-radius: 20px;
}

.names-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.name-card {
    background: linear-gradient(145deg, rgba(255,255,255,0.05), rgba(0,0,0,0.5));
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.name-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(212, 175, 55, 0.2);
    border-color: var(--islam-gold);
    background: linear-gradient(145deg, rgba(212,175,55,0.1), rgba(0,0,0,0.5));
}

.name-card-ar {
    font-family: 'Noto Naskh Arabic', serif;
    font-size: 2.5rem;
    color: white;
    margin-bottom: 10px;
    text-shadow: 0 0 10px rgba(255, 255, 255, 0.2);
}

.name-card-trans {
    font-size: 1rem;
    color: var(--islam-gold);
}

/* ==========================================================================
   Asma-ul-Husna (99 Names) — Card & Modal Styles
   ========================================================================== */

/* Override container bg for the names page */
.names-container {
    background: radial-gradient(ellipse at top, #0d2b1a 0%, #060e0a 100%);
    padding: 40px 20px;
    border-radius: 20px;
    min-height: 60vh;
}

/* Name Card (extends .dua-card) */
.name-asma-card {
    text-align: center;
    direction: rtl;
    padding: 25px 15px 20px;
    position: relative;
}

.name-asma-number {
    position: absolute;
    top: 10px;
    left: 12px;
    font-size: 0.7rem;
    color: rgba(212, 175, 55, 0.5);
    font-family: 'Inter', sans-serif;
    direction: ltr;
}

.name-asma-arabic {
    font-family: 'Noto Naskh Arabic', serif !important;
    font-size: 2.2rem !important;
    color: white !important;
    line-height: 1.6;
    margin-bottom: 8px;
    text-shadow: 0 0 20px rgba(212, 175, 55, 0.3);
}

.name-asma-urdu {
    font-family: 'Noto Nastaliq Urdu', serif;
    font-size: 1rem;
    color: var(--islam-gold);
    direction: rtl;
    margin-bottom: 4px;
}

.name-asma-trans {
    font-size: 0.8rem;
    color: #94a3b8;
    direction: ltr;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.5px;
}

/* Modal overrides for Names */
.names-modal-content {
    max-width: 650px;
    padding: 40px;
}

.names-modal-number {
    text-align: center;
    font-size: 0.8rem;
    color: rgba(212, 175, 55, 0.6);
    margin-bottom: 10px;
    letter-spacing: 2px;
    font-family: 'Inter', sans-serif;
}

.names-modal-arabic {
    font-family: 'Noto Naskh Arabic', serif;
    font-size: 3.5rem;
    color: var(--islam-gold);
    text-align: center;
    margin-bottom: 10px;
    text-shadow: 0 0 30px rgba(212, 175, 55, 0.4);
    line-height: 1.4;
}

/* Info Blocks */
.names-modal-body {
    margin-top: 25px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.names-info-block {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(212, 175, 55, 0.15);
    border-radius: 12px;
    padding: 18px 20px;
}

.names-info-label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--islam-gold);
    margin-bottom: 10px;
    font-family: 'Inter', sans-serif;
    letter-spacing: 0.5px;
    text-align: center;
}
.names-info-label span[dir="rtl"] {
    font-family: 'Jameel Noori Nastaleeq', 'Noto Nastaliq Urdu', serif;
    font-size: 1.1rem;
    font-weight: normal;
}

.names-info-text {
    font-size: 0.95rem;
    line-height: 1.9;
    color: #cbd5e1;
}

.rtl-text {
    direction: rtl;
    text-align: right;
    font-family: 'Noto Nastaliq Urdu', serif;
    margin-bottom: 8px;
}

.ltr-text {
    direction: ltr;
    text-align: left;
    font-family: 'Inter', sans-serif;
    color: #94a3b8;
    font-size: 0.88rem;
}

/* Wazifa Block */
.names-wazifa-block {
    background: linear-gradient(135deg, rgba(15, 81, 50, 0.3), rgba(212, 175, 55, 0.08));
    border-color: rgba(15, 81, 50, 0.5);
}

.names-wazifa-text {
    font-family: 'Noto Nastaliq Urdu', serif;
    font-size: 1.1rem;
    color: #6ee7b7;
    direction: rtl;
    text-align: right;
    line-height: 1.8;
}

/* RTL flow for the grid itself */
#names-asma-grid {
    direction: rtl;
}




