/* 
  allah.wiki - Premium Design System
  Fonts used:
  - Amiri (for Arabic text)
  - Outfit (for headings and branding)
  - Inter (for body text and translations)
*/

:root {
    /* Color Palette - Dark Mode (Default) */
    --bg-gradient-start: #040e0b;
    --bg-gradient-end: #092118;
    --card-bg: rgba(13, 42, 31, 0.5);
    --card-border: rgba(212, 175, 55, 0.15);
    --card-hover-bg: rgba(20, 60, 45, 0.7);
    --card-hover-border: rgba(212, 175, 55, 0.4);
    
    --text-primary: #f5f5f5;
    --text-secondary: #a0b2aa;
    --text-muted: #6e847c;
    
    --accent-gold: #d4af37;
    --accent-gold-hover: #f3cf55;
    --accent-emerald: #10b981;
    --shadow-color: rgba(0, 0, 0, 0.5);
    
    --glass-blur: 16px;
    --border-radius-lg: 16px;
    --border-radius-md: 12px;
    --border-radius-sm: 8px;
    
    --font-ui: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    --font-arabic: 'Amiri', serif;
}

[data-theme="light"] {
    /* Color Palette - Light Mode */
    --bg-gradient-start: #fbfaf7;
    --bg-gradient-end: #f3efe6;
    --card-bg: rgba(255, 255, 255, 0.75);
    --card-border: rgba(15, 76, 58, 0.1);
    --card-hover-bg: rgba(255, 255, 255, 0.95);
    --card-hover-border: rgba(15, 76, 58, 0.3);
    
    --text-primary: #1a2c25;
    --text-secondary: #4a6056;
    --text-muted: #7f958b;
    
    --accent-gold: #b38f2d;
    --accent-gold-hover: #d4af37;
    --accent-emerald: #0f4c3a;
    --shadow-color: rgba(15, 76, 58, 0.08);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    width: 100%;
    min-height: 100vh;
    font-family: var(--font-body);
    color: var(--text-primary);
    background: linear-gradient(135deg, var(--bg-gradient-start), var(--bg-gradient-end));
    background-attachment: fixed;
    line-height: 1.6;
    overflow-x: hidden;
    transition: background 0.4s ease, color 0.4s ease;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease, transform 0.2s ease;
}

button, input {
    font-family: inherit;
}

/* Scrollbar Styles */
::-webkit-scrollbar {
    width: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-gradient-start);
}
::-webkit-scrollbar-thumb {
    background: var(--card-border);
    border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent-gold);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-ui);
    font-weight: 600;
    letter-spacing: -0.02em;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Glassmorphism panel base */
.glass-panel {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-lg);
    backdrop-filter: blur(var(--glass-blur));
    -webkit-backdrop-filter: blur(var(--glass-blur));
    box-shadow: 0 8px 32px 0 var(--shadow-color);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

/* Header Styles */
.site-header {
    padding: 20px 0;
    border-bottom: 1px solid rgba(212, 175, 55, 0.05);
    margin-bottom: 40px;
}

.site-header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-ui);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0.1em;
    color: var(--accent-gold);
}

.logo span {
    color: var(--text-primary);
    font-weight: 300;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 20px;
}

.theme-toggle-btn {
    background: none;
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.theme-toggle-btn:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
    transform: scale(1.05);
}

/* Landing Page - Verse Frame */
.verse-frame {
    margin: 60px auto 40px;
    padding: 40px;
    text-align: center;
    position: relative;
    max-width: 900px;
    overflow: hidden;
}

/* Golden Corners decoration */
.verse-frame::before, .verse-frame::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid var(--accent-gold);
}
.verse-frame::before {
    top: 15px;
    left: 15px;
    border-right: none;
    border-bottom: none;
}
.verse-frame::after {
    bottom: 15px;
    right: 15px;
    border-left: none;
    border-top: none;
}

.verse-arabic {
    font-family: var(--font-arabic);
    font-size: 32px;
    line-height: 2;
    color: var(--accent-gold);
    margin-bottom: 24px;
    direction: rtl;
    text-shadow: 0 2px 10px rgba(212, 175, 55, 0.15);
}

.verse-translation {
    font-size: 18px;
    font-style: italic;
    color: var(--text-primary);
    margin-bottom: 16px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.verse-translation.tr {
    font-size: 16px;
    color: var(--text-secondary);
}

.verse-ref {
    font-family: var(--font-ui);
    font-size: 13px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent-gold);
    margin-top: 15px;
}

/* Search Container */
.search-section {
    max-width: 700px;
    margin: 0 auto 50px;
    position: relative;
}

.search-box-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 20px;
    color: var(--text-secondary);
    pointer-events: none;
}

.search-input {
    width: 100%;
    padding: 18px 20px 18px 55px;
    font-size: 16px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 30px;
    color: var(--text-primary);
    outline: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.search-input:focus {
    border-color: var(--accent-gold);
    box-shadow: 0 10px 30px rgba(212, 175, 55, 0.1);
    background: var(--card-hover-bg);
}

/* Autocomplete Dropdown */
.autocomplete-dropdown {
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    width: 100%;
    max-height: 350px;
    overflow-y: auto;
    border-radius: var(--border-radius-lg);
    z-index: 100;
    display: none;
}

.autocomplete-item {
    padding: 14px 24px;
    border-bottom: 1px solid rgba(212, 175, 55, 0.05);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.2s ease;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover {
    background: rgba(212, 175, 55, 0.08);
}

.autocomplete-title {
    font-weight: 500;
    color: var(--text-primary);
}

.autocomplete-sub {
    font-size: 13px;
    color: var(--text-secondary);
}

.autocomplete-count {
    font-family: var(--font-ui);
    font-size: 12px;
    padding: 2px 8px;
    background: rgba(212, 175, 55, 0.15);
    color: var(--accent-gold);
    border-radius: 10px;
}

/* Alphabetical Index */
.alphabet-section {
    margin-bottom: 60px;
    text-align: center;
}

.alphabet-title {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--text-muted);
    margin-bottom: 15px;
}

.alphabet-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    max-width: 900px;
    margin: 0 auto;
}

.alphabet-letter {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.alphabet-letter:hover, .alphabet-letter.active {
    background: var(--accent-gold);
    color: var(--bg-gradient-start);
    font-weight: 600;
    transform: translateY(-2px);
}

/* Topic Index List (when filtering by letter) */
.topics-index-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 16px;
    margin-top: 30px;
    display: none;
}

.index-topic-card {
    padding: 16px;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    text-align: center;
}

.index-topic-card:hover {
    background: var(--card-hover-bg);
    border-color: var(--card-hover-border);
    transform: translateY(-2px);
}

/* Featured Topics Grid */
.featured-section {
    margin-bottom: 60px;
}

.section-title {
    font-size: 20px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--accent-gold);
    margin-bottom: 25px;
    text-align: center;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 40px;
    height: 2px;
    background: var(--accent-gold);
    margin: 8px auto 0;
}

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

.topic-card {
    padding: 24px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    cursor: pointer;
}

.topic-card:hover {
    background: var(--card-hover-bg);
    border-color: var(--card-hover-border);
    transform: translateY(-4px);
}

.topic-title {
    font-size: 18px;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.topic-desc {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
    flex-grow: 1;
}

.topic-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
    color: var(--text-muted);
    border-top: 1px solid rgba(212, 175, 55, 0.05);
    padding-top: 12px;
}

.topic-meta-count {
    color: var(--accent-gold);
    font-weight: 500;
}

/* Topic Details Page Styles */
.topic-header-section {
    margin: 40px 0;
    text-align: center;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 20px;
}

.back-link:hover {
    color: var(--accent-gold);
}

.topic-heading {
    font-size: 36px;
    color: var(--accent-gold);
    margin-bottom: 10px;
}

.topic-subheading {
    font-size: 18px;
    color: var(--text-secondary);
}

.topic-verses-count {
    font-size: 14px;
    color: var(--text-muted);
    margin-top: 10px;
}

/* Verses List */
.verses-list-container {
    max-width: 900px;
    margin: 0 auto 60px;
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.verse-card {
    padding: 30px;
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.verse-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(212, 175, 55, 0.05);
    padding-bottom: 15px;
}

.verse-card-ref {
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 600;
    color: var(--accent-gold);
}

.verse-card-actions {
    display: flex;
    gap: 12px;
}

.action-btn {
    background: none;
    border: 1px solid var(--card-border);
    color: var(--text-secondary);
    cursor: pointer;
    padding: 6px 12px;
    border-radius: var(--border-radius-sm);
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s ease;
}

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

.verse-card-arabic {
    font-family: var(--font-arabic);
    font-size: 28px;
    line-height: 1.8;
    color: var(--text-primary);
    direction: rtl;
    text-align: right;
    margin-top: 10px;
    font-weight: 400;
}

.verse-card-translation {
    display: flex;
    flex-direction: column;
    gap: 12px;
    border-left: 3px solid rgba(212, 175, 55, 0.3);
    padding-left: 16px;
}

.translation-item {
    font-size: 15px;
    line-height: 1.6;
}

.translation-item .lang-label {
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--accent-gold);
    display: block;
    margin-bottom: 2px;
    letter-spacing: 0.05em;
}

.translation-item.tr {
    color: var(--text-secondary);
}

/* Footer */
.site-footer {
    padding: 40px 0;
    border-top: 1px solid rgba(212, 175, 55, 0.05);
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    margin-top: auto;
}

.site-footer a:hover {
    color: var(--accent-gold);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.4s ease forwards;
}

/* Toast Message */
.toast-msg {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #0f4c3a;
    color: #fff;
    border: 1px solid #d4af37;
    padding: 12px 24px;
    border-radius: var(--border-radius-md);
    box-shadow: 0 4px 12px rgba(0,0,0,0.3);
    font-family: var(--font-ui);
    font-size: 14px;
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

/* Responsive Styles */
@media (max-width: 768px) {
    .verse-frame {
        padding: 24px;
        margin-top: 30px;
    }
    .verse-arabic {
        font-size: 24px;
    }
    .verse-translation {
        font-size: 15px;
    }
    .topic-heading {
        font-size: 28px;
    }
    .verse-card {
        padding: 20px;
    }
    .verse-card-arabic {
        font-size: 22px;
    }
    .alphabet-letter {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
}

/* Custom Dropdown Styling */
.custom-dropdown {
    position: relative;
    user-select: none;
    cursor: pointer;
    font-family: var(--font-ui);
    font-size: 14px;
    font-weight: 600;
    width: 160px;
}

.dropdown-trigger {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    padding: 10px 16px;
    border-radius: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px 0 var(--shadow-color);
}

.dropdown-trigger:hover, .custom-dropdown.active .dropdown-trigger {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
}

.dropdown-arrow {
    transition: transform 0.3s ease;
}

.custom-dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    width: 100%;
    max-height: 280px;
    overflow-y: auto;
    border-radius: var(--border-radius-md);
    z-index: 1000;
    display: none;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.custom-dropdown.active .dropdown-menu {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.dropdown-item {
    padding: 10px 16px;
    color: var(--text-primary);
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(212, 175, 55, 0.03);
    text-align: left;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: rgba(212, 175, 55, 0.08);
    color: var(--accent-gold);
}

.dropdown-item.selected {
    background: rgba(212, 175, 55, 0.15);
    color: var(--accent-gold);
}

/* Highlighted Translations in Verse Cards */
.translation-item.selected {
    color: var(--text-primary) !important;
    font-weight: 500;
    font-size: 16px;
    border-left: 3px solid var(--accent-gold);
    padding-left: 14px;
    margin-bottom: 8px;
}

.translation-item.secondary {
    color: var(--text-secondary) !important;
    font-size: 14px;
    opacity: 0.75;
    border-left: 3px solid rgba(212, 175, 55, 0.15);
    padding-left: 14px;
}

/* Donation Button and Link Styles */
.donation-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: var(--border-radius-md);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    border: 1px solid var(--card-border);
    cursor: pointer;
    transition: all 0.3s ease;
}

.donation-btn:hover {
    border-color: var(--accent-gold);
    color: var(--accent-gold);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(212, 175, 55, 0.15);
}

.donation-link {
    color: var(--accent-gold);
    font-weight: 500;
    margin-left: 10px;
    transition: all 0.2s ease;
}

.donation-link:hover {
    color: var(--accent-gold-hover);
    text-decoration: underline;
}


