* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Raleway', sans-serif;
    height: 100vh;
    overflow: hidden;
    color: rgba(255, 255, 255, 0.95);
}

.bg-image {
    position: fixed;
    inset: 0;
    background-size: cover;
    background-position: center;
    z-index: -2;
}

.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: -1;
}

.container {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    gap: 0.75rem;
}

.glass {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 16px;
}

/* Navigation */
.nav {
    display: flex;
    gap: 0.25rem;
    padding: 0.35rem;
    border-radius: 12px;
}

.nav-btn {
    padding: 0.5rem 1rem;
    background: transparent;
    border: none;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-family: 'Raleway', sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.1);
}

.nav-btn.active {
    color: white;
    background: rgba(255, 255, 255, 0.2);
}

/* Pages */
.page {
    display: none;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    animation: fadeIn 0.3s ease;
}

.page.active {
    display: flex;
}

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

/* Header */
.header {
    text-align: center;
    padding: 0.75rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.header h1 {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
}

.search-box {
    position: relative;
}

.search-box input {
    width: 180px;
    padding: 0.5rem 0.75rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-family: 'Raleway', sans-serif;
    font-size: 0.8rem;
    outline: none;
}

.search-box input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.search-box input:focus {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.4);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(20, 20, 20, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 8px;
    margin-top: 0.25rem;
    display: none;
    z-index: 100;
    max-height: 150px;
    overflow-y: auto;
}

.search-results.active {
    display: block;
}

.search-result-item {
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 0.8rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.search-result-item:hover {
    background: rgba(255, 255, 255, 0.1);
}

.location {
    font-size: 0.8rem;
    opacity: 0.7;
}

/* Main Content */
.main-content {
    display: flex;
    gap: 0.75rem;
    align-items: stretch;
}

/* Next Prayer */
.next-prayer {
    text-align: center;
    padding: 1.25rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.next-prayer .label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.6;
}

.next-prayer h2 {
    font-family: 'Playfair Display', serif;
    font-size: 1.75rem;
    font-weight: 400;
    margin: 0.25rem 0;
}

.countdown #timer {
    font-size: 2.25rem;
    font-weight: 300;
    letter-spacing: 1px;
}

/* Prayer Times */
.prayer-times {
    padding: 0.5rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.25rem 0.5rem;
}

.prayer-row {
    display: flex;
    justify-content: space-between;
    padding: 0.5rem 0.75rem;
    border-radius: 8px;
    transition: background 0.2s;
}

.prayer-row.active {
    background: rgba(255, 255, 255, 0.15);
}

.prayer-row.passed {
    opacity: 0.4;
}

.prayer-row .name {
    font-size: 0.85rem;
}

.prayer-row .time {
    font-size: 0.85rem;
    font-weight: 500;
    margin-left: 1rem;
}

/* Footer */
.footer {
    text-align: center;
    padding: 0.5rem 1.25rem;
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.ramadan-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.6;
}

.ramadan-countdown {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
}

/* ========== TASBEEH PAGE ========== */
#page-tasbeeh {
    position: relative;
    width: 90%;
    max-width: 600px;
    height: calc(100vh - 120px);
    overflow: hidden;
    border-radius: 24px;
}

.tasbeeh-media-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    border-radius: 24px;
    overflow: hidden;
}

.tasbeeh-media-bg video,
.tasbeeh-media-bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: none;
}

.tasbeeh-media-bg video.active,
.tasbeeh-media-bg img.active {
    display: block;
}

.tasbeeh-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1;
    border-radius: 24px;
}

.tasbeeh-page {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 2rem 3rem;
    min-width: 320px;
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
}

.tasbeeh-page .label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.6;
    display: block;
    margin-bottom: 1rem;
}

.tasbeeh-counter {
    font-family: 'Playfair Display', serif;
    font-size: 5rem;
    font-weight: 600;
    margin: 0.5rem 0;
    transition: transform 0.1s;
}

.tasbeeh-phrase {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    direction: rtl;
}

.tasbeeh-translation {
    font-size: 1rem;
    opacity: 0.7;
    margin-bottom: 1.5rem;
}

.tasbeeh-controls {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    margin-bottom: 0.75rem;
}

.secondary-controls {
    margin-bottom: 1rem;
}

.tasbeeh-btn {
    padding: 0.75rem 2rem;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 12px;
    color: white;
    font-family: 'Raleway', sans-serif;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.tasbeeh-btn.primary {
    background: rgba(255, 255, 255, 0.25);
    padding: 1rem 3rem;
    font-size: 1.2rem;
}

.tasbeeh-btn:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: scale(1.02);
}

.tasbeeh-btn:active {
    transform: scale(0.98);
}

.tasbeeh-btn.secondary {
    background: rgba(255, 255, 255, 0.1);
    font-size: 0.85rem;
    padding: 0.6rem 1.25rem;
}

.tasbeeh-progress {
    font-size: 0.85rem;
    opacity: 0.6;
    margin-bottom: 1rem;
}

.media-btn {
    margin-top: 0.5rem;
}

/* ========== HADITH PAGE ========== */
.hadith-page {
    text-align: center;
    padding: 2rem 2.5rem;
    max-width: 550px;
}

.hadith-page .label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.6;
    display: block;
    margin-bottom: 1.5rem;
}

.hadith-content {
    margin-bottom: 1.5rem;
}

.hadith-text {
    font-size: 1.15rem;
    line-height: 1.8;
    font-style: italic;
    margin-bottom: 1rem;
}

.hadith-source {
    font-size: 0.85rem;
    opacity: 0.6;
    display: block;
}

.refresh-btn {
    padding: 0.6rem 1.5rem;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    color: white;
    font-family: 'Raleway', sans-serif;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s;
}

.refresh-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

.refresh-btn.large {
    padding: 0.75rem 2rem;
}

/* ========== QURAN PAGE ========== */
.quran-page {
    text-align: center;
    padding: 1.5rem;
    width: 90%;
    max-width: 700px;
    max-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
}

.quran-header {
    margin-bottom: 1rem;
}

.surah-select {
    padding: 0.6rem 1.5rem;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 10px;
    color: white;
    font-family: 'Raleway', sans-serif;
    font-size: 0.95rem;
    cursor: pointer;
    outline: none;
    min-width: 250px;
}

.surah-select option {
    background: #1a1a2e;
    color: white;
}

.surah-info {
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.surah-info h2 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 400;
    margin-bottom: 0.25rem;
}

.surah-info span {
    font-size: 0.9rem;
    opacity: 0.7;
}

.quran-verses {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    text-align: right;
    direction: rtl;
    max-height: 400px;
}

.quran-placeholder {
    text-align: center;
    direction: ltr;
    opacity: 0.5;
    font-style: italic;
}

.verse {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.verse-arabic {
    font-size: 1.5rem;
    line-height: 2.2;
    margin-bottom: 0.5rem;
}

.verse-number {
    display: inline-block;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    line-height: 28px;
    text-align: center;
    font-size: 0.75rem;
    margin-right: 0.5rem;
    direction: ltr;
}

.verse-translation {
    font-size: 0.9rem;
    line-height: 1.6;
    opacity: 0.75;
    direction: ltr;
    text-align: left;
    font-style: italic;
    margin-top: 0.5rem;
}

.quran-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-arrow {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    color: white;
    font-family: 'Raleway', sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.nav-arrow:hover {
    background: rgba(255, 255, 255, 0.2);
}

.nav-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* ========== MOBILE ========== */
@media (max-width: 600px) {
    .container {
        justify-content: flex-start;
        padding-top: 1.5rem;
    }

    .nav {
        flex-wrap: wrap;
        justify-content: center;
    }

    .nav-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.8rem;
    }

    .header {
        flex-direction: column;
        gap: 0.5rem;
    }

    .main-content {
        flex-direction: column;
    }

    .prayer-times {
        grid-template-columns: 1fr;
    }

    .footer {
        flex-direction: column;
        gap: 0.25rem;
    }

    .tasbeeh-page {
        padding: 1.5rem 1.5rem;
        min-width: auto;
        width: 90%;
    }

    .tasbeeh-counter {
        font-size: 4rem;
    }

    .tasbeeh-phrase {
        font-size: 1.5rem;
    }

    .hadith-page, .quran-page {
        width: 90%;
        padding: 1.5rem;
    }

    .quran-arabic {
        font-size: 1.3rem;
    }
}
