/* Variables for High Contrast Premium Theme */
:root {
    --bg-color: #0b192c;
    /* Deep midnight blue for background */
    --card-bg: #1a2a40;
    /* Lighter blue for cards */
    --accent-color: #d4af37;
    /* Luxurious Gold for highlights/progress */
    --text-main: #ffffff;
    /* White for highest readability */
    --text-muted: #a0aec0;
    /* Light gray for secondary text */
    --active-bg: rgba(212, 175, 55, 0.15);
    /* Soft gold background for active prayer */

    --font-family: 'Outfit', sans-serif;
    --radius-lg: 30px;
    --radius-sm: 16px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-family);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    background-image: radial-gradient(circle at top right, rgba(212, 175, 55, 0.05), transparent 40%),
        radial-gradient(circle at bottom left, rgba(212, 175, 55, 0.05), transparent 40%);
}

.app-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    padding: 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
    /* Space safe areas */
}

/* SPA Views */
.spa-view {
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.4s ease;
}

.spa-view.hidden {
    display: none !important;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* Top Utilities Bar */
.top-utilities {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    margin-bottom: 24px;
}

/* Event Banner */
.event-banner {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.15), rgba(212, 175, 55, 0.05));
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--accent-color);
    font-size: 0.95rem;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    animation: fadeInDown 0.5s ease-out;
    flex: 1;
    /* Take up available space left of the icon */
    margin-right: 12px;
}

.event-banner.hidden {
    display: none;
}

.top-icon-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex-shrink: 0;
    padding: 0;
}

.top-icon-btn svg {
    transition: stroke 0.2s ease;
}

.top-icon-btn:hover,
.top-icon-btn:active {
    color: var(--accent-color);
    transform: scale(1.1) translateY(-2px);
}

/* Quote Modal Styles */
.quote-modal-content,
.qibla-modal-content {
    text-align: center;
    max-width: 90%;
    width: 400px;
}

.quote-container {
    padding: 24px;
    background: rgba(0, 0, 0, 0.2);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent-color);
    margin-top: 16px;
    min-height: 120px;
    /* Prevent jitter when tr/ar switches */
    display: flex;
    align-items: center;
    justify-content: center;
}

.quote-text {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-main);
    font-style: italic;
    transition: opacity 0.5s ease;
}

.quote-text.fade {
    opacity: 0;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 32px;
    animation: fadeIn 1s ease-out;
}

/* Back Button */
.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-muted);
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 24px;
}

.btn-back:hover,
.btn-back:active {
    background: rgba(212, 175, 55, 0.1);
    color: var(--accent-color);
    border-color: rgba(212, 175, 55, 0.3);
}

.location-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 12px;
    color: var(--accent-color);
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    transition: background 0.2s;
    font-family: inherit;
}

.location-container:hover,
.location-container:active {
    background: rgba(212, 175, 55, 0.1);
}

.location-text-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

#location-text {
    font-size: 1.2rem;
    font-weight: 600;
}

.location-hint {
    font-size: 0.8rem;
    opacity: 0.7;
    margin-top: -2px;
}

.date-text {
    font-size: 1.1rem;
    color: var(--text-main);
}

.hijri {
    color: var(--text-muted);
    font-size: 1rem;
    margin-top: 4px;
}

/* Countdown Main Area */
.countdown-section {
    background-color: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 20px 16px;
    text-align: center;
    margin-bottom: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(212, 175, 55, 0.1);
    animation: slideUp 0.6s ease-out;
}

#daily-quote {
    font-size: 1.1rem;
    line-height: 1.6;
    color: var(--text-main);
    font-style: italic;
    opacity: 1;
    transition: opacity 0.5s ease-in-out;
}

#daily-quote.fade {
    opacity: 0;
}

.countdown-timer {
    font-size: 3rem;
    font-weight: 700;
    color: var(--accent-color);
    letter-spacing: 1px;
    font-variant-numeric: tabular-nums;
    margin: 8px 0;
    text-shadow: 0 2px 10px rgba(212, 175, 55, 0.2);
}

.time-remaining-label {
    font-size: 1.2rem;
    color: var(--text-muted);
}

/* Qibla Indicator */
.qibla-wrapper {
    background-color: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow: hidden;
    margin-top: 16px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.qibla-compass {
    position: relative;
    width: 120px;
    height: 120px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.compass-ring {
    position: absolute;
    width: 100%;
    height: 100%;
}

.qibla-needle {
    position: absolute;
    width: 48px;
    height: 48px;
    transform-origin: center;
    transition: transform 1.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    /* Bouncy compass effect */
    z-index: 2;
}

.qibla-text {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--text-main);
}

.qibla-hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    opacity: 0.8;
    text-align: center;
}

/* Dynamic Content Area (Quotes etc) */
.times-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 24px;
    animation: fadeIn 1.2s ease-out;
}

.prayer-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background-color: var(--card-bg);
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    transition: all 0.3s ease;
    border-left: 4px solid transparent;
}

/* Highlighting the NEXT prayer */
.prayer-row.active {
    background-color: var(--active-bg);
    border-left-color: var(--accent-color);
    transform: scale(1.02);
}

.prayer-row.active .prayer-name,
.prayer-row.active .prayer-time {
    color: var(--accent-color);
    font-weight: 700;
}

.prayer-name {
    font-size: 1.3rem;
    font-weight: 600;
}

.prayer-time {
    font-size: 1.3rem;
    font-weight: 600;
}

/* Quote of the Day */
.quote-section {
    background-color: var(--card-bg);
    border-radius: var(--radius-sm);
    padding: 20px;
    margin-top: 24px;
    text-align: center;
    border-top: 3px solid var(--accent-color);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    animation: fadeIn 1.5s ease-out;
}

.quote-title {
    font-size: 1.1rem;
    color: var(--accent-color);
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.quote-text {
    font-size: 1.3rem;
    font-style: italic;
    line-height: 1.5;
    color: var(--text-main);
}

/* Zikirmatik Section */
.zikirmatik-section {
    background: linear-gradient(145deg, #1a2a40, #132032);
    border-radius: var(--radius-lg);
    padding: 20px;
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2), inset 0 2px 0 rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(212, 175, 55, 0.15);
    animation: slideUp 0.8s ease-out;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
    animation: fadeIn 1s ease-out;
}

.dashboard-btn {
    background-color: var(--card-bg);
    border-radius: var(--radius-sm);
    padding: 16px 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    color: var(--text-main);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}

.dashboard-btn:hover,
.dashboard-btn:active {
    transform: translateY(-2px);
    background-color: rgba(212, 175, 55, 0.1);
    border-color: rgba(212, 175, 55, 0.3);
}

.dashboard-btn .icon {
    font-size: 1.8rem;
    margin-bottom: 4px;
}

.dashboard-btn .label {
    font-size: 0.8rem;
    font-weight: 500;
    text-align: center;
    color: var(--text-muted);
}


.zikir-screen {
    background-color: #0d1b2a;
    width: 100%;
    padding: 20px;
    border-radius: var(--radius-sm);
    text-align: right;
    margin-bottom: 24px;
    box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.5);
    border: 2px solid #23395d;
}

#zikir-count {
    font-family: 'Courier New', Courier, monospace;
    font-size: 3.5rem;
    font-weight: 700;
    color: var(--accent-color);
    text-shadow: 0 0 10px rgba(212, 175, 55, 0.4);
    font-variant-numeric: tabular-nums;
}

.zikir-controls {
    display: flex;
    width: 100%;
    gap: 16px;
    align-items: stretch;
}

.zikir-btn {
    border: none;
    border-radius: 50px;
    font-family: var(--font-family);
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s ease;
    outline: none;
}

.zikir-btn:active {
    transform: scale(0.95);
    box-shadow: inset 0 4px 10px rgba(0, 0, 0, 0.3);
}

.zikir-btn.add {
    flex: 1;
    background: linear-gradient(135deg, #d4af37, #b5952f);
    color: #0b192c;
    font-size: 1.8rem;
    padding: 16px;
    box-shadow: 0 6px 15px rgba(212, 175, 55, 0.3);
}

.zikir-btn.reset {
    width: 64px;
    background-color: #2c3e50;
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Modal Styling */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(11, 25, 44, 0.85);
    /* Deep backdrop */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 100;
    padding: 20px;
    opacity: 1;
    transition: opacity 0.3s ease;
    backdrop-filter: blur(4px);
}

.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background-color: var(--card-bg);
    border: 2px solid var(--accent-color);
    border-radius: var(--radius-lg);
    padding: 30px;
    width: 100%;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.5);
    transform: translateY(0);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal-overlay.hidden .modal-content {
    transform: translateY(20px);
}

.modal-title {
    color: var(--accent-color);
    font-size: 1.6rem;
    margin-bottom: 15px;
}

.modal-desc {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 20px;
    line-height: 1.4;
}

.modal-input {
    width: 100%;
    background-color: #0b192c;
    border: 2px solid #23395d;
    color: var(--text-main);
    padding: 16px;
    font-size: 1.4rem;
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    font-family: var(--font-family);
    text-align: center;
    outline: none;
    transition: border-color 0.2s;
}

.modal-input:focus {
    border-color: var(--accent-color);
}

/* Autocomplete Custom Dropdown */
.autocomplete-wrapper {
    position: relative;
    width: 100%;
}

.autocomplete-items {
    position: absolute;
    border: 2px solid #23395d;
    border-top: none;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    z-index: 99;
    top: calc(100% - 24px);
    /* Account for modal-input margin-bottom */
    left: 0;
    right: 0;
    background-color: #0d1b2a;
    max-height: 200px;
    overflow-y: auto;
    display: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.autocomplete-items::-webkit-scrollbar {
    width: 6px;
}

.autocomplete-items::-webkit-scrollbar-thumb {
    background-color: #23395d;
    border-radius: 10px;
}

.autocomplete-items.show {
    display: block;
}

.autocomplete-item {
    padding: 12px 16px;
    cursor: pointer;
    background-color: #0b192c;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    font-size: 1.1rem;
    transition: background-color 0.1s;
    text-align: left;
}

.autocomplete-item:last-child {
    border-bottom: none;
}

.autocomplete-item:hover,
.autocomplete-item.autocomplete-active {
    background-color: rgba(212, 175, 55, 0.15);
    color: var(--accent-color);
}

.modal-actions {
    display: flex;
    gap: 12px;
}

.modal-btn {
    flex: 1;
    padding: 14px;
    font-size: 1.2rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-family: inherit;
    transition: transform 0.1s, opacity 0.2s;
}

.modal-btn:active {
    transform: scale(0.96);
}

.modal-btn.primary {
    background-color: var(--accent-color);
    color: #0b192c;
}

.modal-btn.secondary {
    background-color: transparent;
    color: var(--text-main);
    border: 2px solid #2c3e50;
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--bg-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 10;
    border-radius: inherit;
    transition: opacity 0.3s ease;
}

.loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid rgba(212, 175, 55, 0.2);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}

.loading-overlay p {
    font-size: 1.5rem;
    color: var(--accent-color);
}

/* Animations */
@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 800px;
    /* Matches app-container */
    background-color: var(--card-bg);
    border-top: 1px solid rgba(212, 175, 55, 0.1);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 12px 0 calc(20px + env(safe-area-inset-bottom)) 0;
    /* Extra bottom padding for iOS/Android home indicator */
    z-index: 1000;
}

.nav-item {
    background: none;
    border: none;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 0.75rem;
    font-weight: 600;
    cursor: pointer;
    transition: color 0.2s ease;
}

.nav-item svg {
    transition: stroke 0.2s ease, transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.nav-item:hover,
.nav-item:focus {
    color: var(--text-main);
}

.nav-item.active {
    color: var(--accent-color);
}

.nav-item.active svg {
    stroke: var(--accent-color);
    transform: translateY(-2px);
}

/* Dummy Switch Styles */
.settings-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 24px;
}

.setting-item {
    background-color: var(--card-bg);
    padding: 16px;
    border-radius: var(--radius-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.setting-info h3 {
    font-size: 1.1rem;
    color: var(--text-main);
    margin-bottom: 4px;
}

.setting-info p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}

.switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #333;
    transition: .4s;
}

.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
}

input:checked+.slider {
    background-color: var(--accent-color);
}

input:checked+.slider:before {
    transform: translateX(22px);
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
}

/* Quran & Duas Views (Library Grid) */
.quran-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 16px;
}

.quran-card {
    background: linear-gradient(145deg, #1f3653, #162840);
    padding: 24px 16px;
    border-radius: var(--radius-sm);
    margin-bottom: 0;
    transition: transform 0.2s, box-shadow 0.2s;
    border-left: 4px solid transparent;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.quran-card:nth-child(odd) {
    background: linear-gradient(145deg, #1a2a40, #132032);
}

.quran-card:nth-child(even) {
    background: linear-gradient(145deg, #2c3e50, #1a252f);
}

.quran-card:nth-child(3n) {
    background: linear-gradient(145deg, #244136, #162f25);
}

.quran-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.quran-card.expanded {
    grid-column: 1 / -1;
    background: var(--card-bg);
    border-left: 4px solid var(--accent-color);
    text-align: left;
    align-items: flex-start;
}

.quran-header {
    width: 100%;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.quran-card.expanded .quran-header {
    align-items: flex-start;
}

.quran-header h3 {
    color: var(--accent-color);
    margin-bottom: 8px;
    font-size: 1.3rem;
}

.quran-header p {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.quran-content {
    display: none;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.quran-card.expanded .quran-content {
    display: block;
    animation: fadeInDown 0.3s ease;
}

.ar-text {
    font-size: 1.6rem;
    text-align: right;
    direction: rtl;
    color: var(--accent-color);
    margin-bottom: 16px;
    line-height: 2;
}

.tr-text {
    font-size: 1.05rem;
    color: var(--text-main);
    line-height: 1.6;
}

.imsakiye-table-container {
    margin-top: 20px;
    overflow-x: auto;
}

.imsakiye-table {
    width: 100%;
    border-collapse: collapse;
    text-align: center;
}

.imsakiye-table th {
    color: var(--accent-color);
    padding: 10px;
    border-bottom: 1px solid #333;
}

.imsakiye-table td {
    padding: 12px 8px;
    border-bottom: 1px solid #222;
    font-size: 0.9rem;
}

/* Gamification (Profile) Styles */
.profile-hero {
    background: linear-gradient(145deg, #1a2a40, #132032);
    border-radius: var(--radius-lg);
    padding: 32px 20px;
    text-align: center;
    border: 1px solid rgba(212, 175, 55, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.level-badge {
    width: 64px;
    height: 64px;
    background: rgba(212, 175, 55, 0.1);
    border: 2px solid var(--accent-color);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 16px;
    box-shadow: 0 0 15px rgba(212, 175, 55, 0.3);
}

.rank-title {
    color: var(--accent-color);
    font-size: 1.5rem;
    margin-bottom: 4px;
}

.level-text {
    font-size: 1rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.progress-wrapper {
    width: 100%;
}

.progress-bar-container {
    width: 100%;
    height: 12px;
    background-color: #0b192c;
    border-radius: 6px;
    overflow: hidden;
    margin-bottom: 8px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.5);
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #b5952f, #d4af37);
    border-radius: 6px;
    transition: width 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.progress-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-family: 'Courier New', Courier, monospace;
}

.stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background-color: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 16px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-icon {
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.section-title {
    font-size: 1.2rem;
    margin-bottom: 16px;
    color: var(--accent-color);
    border-bottom: 1px solid rgba(212, 175, 55, 0.2);
    padding-bottom: 8px;
}

.quests-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 32px;
}

.quest-item {
    background-color: var(--card-bg);
    border-radius: var(--radius-sm);
    padding: 16px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 3px solid transparent;
}

.quest-item.completed {
    border-left-color: var(--accent-color);
    opacity: 0.8;
}

.quest-info h4 {
    font-size: 1rem;
    margin-bottom: 4px;
    color: var(--text-main);
}

.quest-info p {
    font-size: 0.85rem;
    color: var(--accent-color);
    font-weight: 600;
}

.quest-btn {
    background: transparent;
    border: 1px solid var(--accent-color);
    color: var(--accent-color);
    padding: 8px 16px;
    border-radius: 20px;
    font-family: inherit;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.quest-item.completed .quest-btn {
    background: rgba(212, 175, 55, 0.2);
    border-color: transparent;
    color: var(--text-muted);
    cursor: default;
}

.badges-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 32px;
}

.badge-item {
    background-color: var(--card-bg);
    border-radius: var(--radius-sm);
    padding: 12px 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    opacity: 0.5;
    filter: grayscale(1);
    transition: all 0.3s;
    border: 1px solid transparent;
}

.badge-item.unlocked {
    opacity: 1;
    filter: grayscale(0);
    box-shadow: 0 4px 10px rgba(212, 175, 55, 0.1);
    border: 1px solid rgba(212, 175, 55, 0.2);
    transform: scale(1.02);
}

/* Badge Tiers */
.badge-item.unlocked.tier-1 {
    border-color: #cd7f32;
    /* Bronze */
    box-shadow: 0 4px 10px rgba(205, 127, 50, 0.2);
}

.badge-item.unlocked.tier-1 .badge-name {
    color: #cd7f32;
}

.badge-item.unlocked.tier-2 {
    border-color: #c0c0c0;
    /* Silver */
    box-shadow: 0 4px 10px rgba(192, 192, 192, 0.2);
}

.badge-item.unlocked.tier-2 .badge-name {
    color: #c0c0c0;
}

.badge-item.unlocked.tier-3 {
    border-color: #ffd700;
    /* Gold */
    box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.badge-item.unlocked.tier-3 .badge-name {
    color: #ffd700;
}

.badge-icon {
    font-size: 2rem;
    margin-bottom: 8px;
}

.badge-name {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.badge-tier {
    font-size: 0.65rem;
    color: var(--text-muted);
    margin-top: 4px;
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 10px;
}

/* Leaderboard View */
.leaderboard-podium {
    display: flex;
    justify-content: center;
    align-items: flex-end;
    gap: 16px;
    margin-bottom: 32px;
    margin-top: 16px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.podium-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex: 1;
    /* Equal space distribution */
    max-width: 30%;
}

.podium-avatar {
    font-size: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    border: 2px solid;
}

.step-1 .podium-avatar {
    border-color: #ffd700;
    transform: scale(1.2);
    margin-bottom: 12px;
}

.step-2 .podium-avatar {
    border-color: #c0c0c0;
}

.step-3 .podium-avatar {
    border-color: #cd7f32;
}

.podium-name {
    font-size: 0.8rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 4px;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.podium-sp {
    font-size: 0.7rem;
    color: var(--text-muted);
    font-family: monospace;
    margin-bottom: 8px;
}

.podium-block {
    width: 100%;
    border-radius: 8px 8px 0 0;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    padding-bottom: 12px;
    font-size: 1.5rem;
    font-weight: 800;
    color: rgba(0, 0, 0, 0.5);
}

.step-1 .podium-block {
    height: 120px;
    background: linear-gradient(180deg, #ffd700, #b8860b);
}

.step-2 .podium-block {
    height: 90px;
    background: linear-gradient(180deg, #c0c0c0, #808080);
}

.step-3 .podium-block {
    height: 70px;
    background: linear-gradient(180deg, #cd7f32, #8b4513);
}

.leaderboard-list {
    background: var(--card-bg);
    border-radius: var(--radius-md);
    padding: 16px;
    margin-bottom: 32px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

#leaderboard-ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.leaderboard-item {
    display: flex;
    align-items: center;
    padding: 12px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.leaderboard-item:last-child {
    border-bottom: none;
}

.leaderboard-item.is-me {
    background: rgba(212, 175, 55, 0.1);
    border-radius: var(--radius-sm);
    border: 1px solid rgba(212, 175, 55, 0.3);
}

.leaderboard-rank {
    font-weight: 700;
    color: var(--accent-color);
    width: 30px;
}

.leaderboard-name {
    flex: 1;
    font-weight: 600;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 8px;
    /* Ensure space before SP */
}

.leaderboard-sp {
    font-family: monospace;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.leaderboard-item.is-me .leaderboard-name,
.leaderboard-item.is-me .leaderboard-sp {
    color: var(--accent-color);
}


/* Audio & Adhan Styles */
.btn-play-surah {
    background: rgba(212, 175, 55, 0.1);
    color: var(--accent-color);
    border: 1px solid rgba(212, 175, 55, 0.3);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 16px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s;
}

.btn-play-surah:hover,
.btn-play-surah.playing {
    background: var(--accent-color);
    color: var(--bg-color);
}

.adhan-pulse-icon {
    animation: pulseAdhan 2s infinite;
}

@keyframes pulseAdhan {
    0% {
        transform: scale(1);
        opacity: 1;
        filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.5));
    }

    50% {
        transform: scale(1.1);
        opacity: 0.8;
        filter: drop-shadow(0 0 30px rgba(212, 175, 55, 1));
    }

    100% {
        transform: scale(1);
        opacity: 1;
        filter: drop-shadow(0 0 10px rgba(212, 175, 55, 0.5));
    }
}

/* Accessibility for smaller phones */
@media (max-width: 380px) {
    .countdown-timer {
        font-size: 2.2rem;
        /* Overrides previous 3rem */
    }

    .prayer-name,
    .prayer-time {
        font-size: 1.5rem;
    }

    .quran-header h3 {
        font-size: 1rem;
    }

    .nav-item {
        font-size: 0.7rem;
    }

    /* Leaderboard Mobile Fixes */
    .leaderboard-podium {
        gap: 8px;
        /* Less gap between podium bars */
    }

    .step-1 .podium-block {
        height: 100px;
    }

    .step-2 .podium-block {
        height: 80px;
    }

    .step-3 .podium-block {
        height: 60px;
    }

    .podium-name {
        font-size: 0.7rem;
        /* Shrink text further */
    }

    .leaderboard-list {
        padding: 8px;
        /* Reduce side padding for the list */
    }

    .leaderboard-item {
        padding: 10px 4px;
        /* Tighter rows */
    }

    .leaderboard-rank {
        width: 24px;
        font-size: 0.9rem;
    }

    .leaderboard-name {
        font-size: 0.9rem;
    }

    .leaderboard-sp {
        font-size: 0.75rem;
    }
}

/* --- QURAN READER BOOK STYLES (TR+AR) --- */
.quran-reader-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background: var(--card-bg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    position: sticky;
    top: 0;
    z-index: 10;
}

.quran-meta {
    text-align: center;
    flex-grow: 1;
}

.quran-meta h2 {
    font-size: 1.2rem;
    color: var(--accent-color);
    margin: 0;
}

.quran-search-btn {
    background: transparent;
    border: none;
    color: var(--accent-color);
    /* Yellow magnifying glass */
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    padding: 0;
}

.quran-search-btn:hover,
.quran-search-btn:active {
    transform: scale(1.1) translateY(-2px);
    color: #ffd700;
    /* Brighter yellow on hover */
}

.quran-reader-body {
    flex-grow: 1;
    overflow-y: auto;
    padding: 20px 15px;
    padding-bottom: 100px;
    background: #fdf6e3;
    /* SOLARIZED PARCHMENT / BOOK BACKGROUND */
    scrollbar-width: thin;
    scrollbar-color: #d4af37 #fdf6e3;
    color: #3e2723;
    /* DARK BROWN INK TEXT */
}

/* Ayah Block Container */
.ayah-block {
    display: flex;
    flex-direction: column;
    margin-bottom: 25px;
    padding: 20px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 1px dashed rgba(93, 64, 55, 0.2);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.ayah-block:hover {
    background-color: rgba(93, 64, 55, 0.05);
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

/* Green Highlight when playing */
.ayah-block.playing {
    background-color: rgba(46, 204, 113, 0.15);
    border: 1px solid rgba(46, 204, 113, 0.4);
    box-shadow: 0 0 15px rgba(46, 204, 113, 0.2);
}

.ayah-block.playing .quran-ayah-ar,
.ayah-block.playing .quran-ayah-tr {
    color: #1b5e20;
}

/* Arabic Text Typography */
.quran-ayah-ar {
    direction: rtl;
    text-align: center;
    font-family: 'Amiri', 'Traditional Arabic', serif;
    font-size: 2.2rem;
    line-height: 2.4;
    color: #3e2723;
    font-weight: 500;
}

.ayah-number {
    color: #b78a3c;
    font-size: 1.6rem;
    margin: 0 5px;
    user-select: none;
    font-weight: normal;
}

/* Turkish Text Typography */
.quran-ayah-tr {
    direction: ltr;
    text-align: center;
    font-family: 'Inter', sans-serif;
    font-size: 1.15rem;
    line-height: 1.6;
    color: #5d4037;
    margin-top: 15px;
    font-weight: 400;
}

.quran-surah-separator {
    text-align: center;
    margin: 40px 0 20px 0;
    padding: 20px;
    background: linear-gradient(90deg, transparent, rgba(212, 175, 55, 0.2), transparent);
    border-top: 2px double rgba(212, 175, 55, 0.5);
    border-bottom: 2px double rgba(212, 175, 55, 0.5);
}

.quran-surah-separator h3 {
    color: #3e2723;
    font-size: 2rem;
    margin: 0 0 5px 0;
    font-family: 'Amiri', serif;
}

.quran-surah-separator p {
    color: #5d4037;
    font-size: 1.1rem;
    margin: 0;
    font-family: 'Inter', sans-serif;
    direction: ltr;
}

.quran-bismillah {
    text-align: center;
    font-size: 2.5rem;
    color: #3e2723;
    margin: 15px 0 30px 0;
    font-family: 'Amiri', serif;
}

/* VCR Controls Footer */
.quran-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 30px;
    padding: 15px 20px;
    background: var(--card-bg);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 10;
    width: 100%;
    box-sizing: border-box;
    backdrop-filter: blur(10px);
}

.quran-nav-btn {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: var(--text-main);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.quran-nav-btn:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.05);
}

.quran-nav-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.quran-play-btn {
    background: var(--accent-color);
    border: none;
    color: var(--bg-color);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

.quran-play-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(212, 175, 55, 0.6);
}

.quran-play-btn:active {
    transform: scale(0.95);
}

/* --- DUALAR (PRAYERS & SURAHS) STYLES --- */
#view-dualar {
    background: #fdf6e3;
    /* Solarized Parchment Background */
    color: #3e2723;
}

#view-dualar .header {
    background: var(--bg-color);
    margin-bottom: 0;
    padding: 20px;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

#view-dualar .btn-back {
    color: var(--accent-color);
    border-color: rgba(212, 175, 55, 0.3);
}

#view-dualar .quran-meta h2,
#view-dualar .quran-meta p {
    color: var(--accent-color);
}

.dualar-tabs {
    display: flex;
    justify-content: center;
    gap: 15px;
    padding: 20px;
    background: transparent;
}

.dualar-tab-btn {
    background: rgba(93, 64, 55, 0.1);
    border: 1px solid rgba(93, 64, 55, 0.2);
    color: #5d4037;
    padding: 10px 20px;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    flex: 1;
    max-width: 180px;
}

.dualar-tab-btn.active {
    background: #d4af37;
    color: #fff;
    border-color: #d4af37;
    box-shadow: 0 4px 10px rgba(212, 175, 55, 0.3);
}

.dualar-list {
    padding: 10px 20px 40px 20px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    overflow-y: auto;
}

.dualar-list.hidden {
    display: none;
}

.dualar-card {
    background: #fffdf7;
    border: 1px solid rgba(212, 175, 55, 0.3);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.dualar-card-header {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.05), transparent);
}

.dualar-card-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: #3e2723;
    font-weight: 700;
}

.dualar-audio-btn {
    background: transparent;
    border: 1px solid rgba(212, 175, 55, 0.5);
    color: #d4af37;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.dualar-audio-btn:hover {
    background: rgba(212, 175, 55, 0.1);
    transform: scale(1.05);
}

.dualar-audio-btn.active {
    background: #d4af37;
    color: #fff;
    border-color: #d4af37;
    animation: pulseAdhan 2s infinite;
}

.dualar-card-body {
    padding: 0 20px;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-top: 1px dashed transparent;
}

.dualar-card.expanded .dualar-card-body {
    padding: 20px;
    max-height: 1000px;
    /* large enough to fit content */
    opacity: 1;
    border-top-color: rgba(212, 175, 55, 0.3);
}

.dualar-pronunciation {
    font-style: italic;
    color: #795548;
    margin-top: 15px;
    font-size: 1.05rem;
    line-height: 1.5;
    text-align: center;
}

.dualar-card.playing {
    border-color: #d4af37;
    box-shadow: 0 4px 15px rgba(212, 175, 55, 0.15);
}

.dualar-card.playing .quran-ayah-ar,
.dualar-card.playing .quran-ayah-tr,
.dualar-card.playing .dualar-pronunciation {
    color: #1b5e20;
    /* Deep green reading highlight */
}