:root {
    --emerald: #075B45;
    --gold: #D6B66D;
    --ivory: #F7F5EE;
    --white: #FFFFFF;
    --text-pri: #24312D;
    --text-sec: #68736D;
    --soft: rgba(7, 91, 69, 0.08);
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    font-family: 'Inter', 'Noto Sans Bengali', sans-serif;
}

html, body {
    margin: 0;
    min-height: 100%;
    background: #dfe4df;
    overscroll-behavior: none;
}

body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 16px;
    background:
        radial-gradient(circle at top, rgba(7, 91, 69, 0.18), transparent 28%),
        linear-gradient(135deg, #edf0ec 0%, #dfe4df 100%);
}

button, input {
    font: inherit;
}

.device-frame {
    width: min(390px, 100%);
    height: min(844px, calc(100vh - 24px));
    background: #000;
    border-radius: 36px;
    padding: 12px;
    box-shadow: 0 22px 50px rgba(0,0,0,0.18);
    position: relative;
    border: 1px solid rgba(0,0,0,0.08);
}

.screen-container {
    width: 100%;
    height: 100%;
    background: var(--ivory);
    border-radius: 28px;
    overflow: hidden;
    position: relative;
}

.screen {
    display: none;
    height: 100%;
    width: 100%;
    flex-direction: column;
    position: absolute;
    top: 0;
    left: 0;
    background: var(--ivory);
}

.screen.active {
    display: flex;
}

.has-bottom-nav {
    padding-bottom: 78px;
}

.bg-ivory { background: var(--ivory); }

.splash-bg {
    background: linear-gradient(135deg, var(--emerald), #0a735d);
    color: var(--white);
    justify-content: center;
    align-items: center;
    text-align: center;
}

.splash-logo { font-size: 60px; color: var(--gold); margin-bottom: 18px; }
.splash-title { font-size: 32px; letter-spacing: -0.03em; margin-bottom: 8px; }
.splash-tagline { color: rgba(255,255,255,0.86); }

.text-center { text-align: center; }
.text-secondary { color: var(--text-sec); }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.mt-30 { margin-top: 30px; }
.mb-10 { margin-bottom: 10px; }
.mb-20 { margin-bottom: 20px; }
.mr-10 { margin-right: 10px; }
.ml-10 { margin-left: 10px; }
.w-100 { width: 100%; }
.small-text { font-size: 12px; }
.flex-center { display: flex; flex-direction: column; align-items: center; justify-content: center; }

.btn {
    background: transparent;
    border-radius: 14px;
    border: none;
    padding: 14px 20px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s ease;
}
.btn-primary { background: var(--emerald); color: var(--white); }
.btn-outline { border: 1.5px solid var(--emerald); color: var(--emerald); background: transparent; }
.btn-outline.active { background: var(--emerald); color: var(--white); }
.btn-text { color: var(--text-pri); }
.btn-sm { padding: 8px 14px; font-size: 13px; }

h2 { color: var(--text-pri); font-size: 24px; }
h3 { color: var(--text-pri); font-size: 18px; }
h4 { color: var(--text-pri); font-size: 16px; }
p { color: var(--text-pri); line-height: 1.55; }

.onboarding-content {
    height: 100%;
    padding: 32px 24px 20px;
    display: flex;
    flex-direction: column;
    text-align: center;
}
.illustration-placeholder {
    margin: 36px auto 20px;
    width: 120px;
    height: 120px;
    border-radius: 30px;
    background: rgba(7, 91, 69, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
}
.illustration-placeholder i {
    font-size: 64px;
    color: var(--emerald);
}
.subtitle { margin-top: 10px; color: var(--text-sec); }
.lang-selector {
    display: flex;
    gap: 10px;
    margin-top: 28px;
}
.lang-selector .btn { flex: 1; }
.location-card {
    background: var(--white);
    border-radius: 18px;
    padding: 16px;
    display: flex;
    gap: 14px;
    align-items: center;
    text-align: left;
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}
.location-card i { color: var(--emerald); font-size: 24px; }
.bottom-actions { margin-top: auto; margin-bottom: 16px; }

.header, .top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: calc(38px + var(--safe-top)) 20px 18px;
    background: var(--ivory);
}
.greeting { font-size: 20px; font-weight: 700; }
.location { margin-top: 4px; font-size: 14px; color: var(--text-sec); }
.icon-btn { font-size: 20px; color: var(--text-pri); }

.content-scroll {
    padding: 0 20px 20px;
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.content-scroll::-webkit-scrollbar { display: none; }

.card, .list-card, .info-card {
    background: var(--white);
    border-radius: 18px;
    padding: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    margin-bottom: 15px;
}

.date-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--text-sec);
    font-weight: 500;
}

.next-prayer-card {
    background: linear-gradient(135deg, var(--emerald), #0e7c63);
    color: var(--white);
    border-radius: 18px;
    padding: 24px 20px;
    text-align: center;
    margin-bottom: 18px;
    cursor: pointer;
}
.next-prayer-card h3 { color: var(--gold); }
.next-prayer-card h1 { font-size: 42px; margin: 10px 0; }
.next-prayer-card p { color: rgba(255,255,255,0.9); }

.prayers-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    background: var(--white);
    border-radius: 18px;
    padding: 14px 12px;
    margin-bottom: 20px;
}
.prayer-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--text-sec);
    flex: 1;
}
.prayer-col.active { color: var(--emerald); font-weight: 700; }
.prayer-col.active span:last-child {
    background: var(--emerald);
    color: var(--white);
    padding: 3px 8px;
    border-radius: 10px;
}

.quick-actions {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 24px;
}
.action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
}
.icon-circle {
    width: 52px;
    height: 52px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--white);
    color: var(--emerald);
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.section-title {
    font-size: 18px;
    margin-bottom: 12px;
}

.mosque-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    cursor: pointer;
}
.card-info { flex: 1; }
.quote-card {
    background: var(--emerald);
    color: var(--white);
    text-align: center;
    padding: 22px 20px;
}
.quote-card p { color: var(--white); font-style: italic; }
.quote-card .ref { color: var(--gold); font-size: 13px; margin-top: 8px; }

.module-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 10px;
}
.module-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 120px;
    background: var(--white);
    border-radius: 18px;
    padding: 16px 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
    text-align: center;
    cursor: pointer;
}
.module-card i { font-size: 24px; color: var(--emerald); }

.list-card {
    padding: 0;
    overflow: hidden;
}
.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid rgba(0,0,0,0.04);
    font-weight: 500;
}
.list-item:last-child { border-bottom: none; }
.list-item.clickable { cursor: pointer; }
.active-list-item {
    background: rgba(7, 91, 69, 0.05);
    color: var(--emerald);
    font-weight: 700;
}
.compact-card { padding: 0; }

.search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--white);
    border-radius: 14px;
    padding: 12px 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}
.search-bar input {
    width: 100%;
    border: none;
    background: transparent;
    outline: none;
    font-size: 15px;
}

.tags .tag {
    display: inline-block;
    background: rgba(214, 182, 109, 0.22);
    color: #8d6d1f;
    padding: 4px 10px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    margin-right: 6px;
}

.cover-img {
    height: 220px;
    position: relative;
}
.mosque-cover {
    background: linear-gradient(rgba(0,0,0,0.2), rgba(0,0,0,0.2)), url('https://images.unsplash.com/photo-1564769625905-50e93615e769?auto=format&fit=crop&q=80&w=600') center/cover;
}
.biz-cover {
    background: linear-gradient(rgba(0,0,0,0.2), rgba(0,0,0,0.2)), url('https://images.unsplash.com/photo-1555939594-58d7cb561ad1?auto=format&fit=crop&q=80&w=600') center/cover;
}
.back-btn-overlay {
    position: absolute;
    top: 40px;
    left: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    cursor: pointer;
}
.overlap-content {
    margin-top: -24px;
    position: relative;
    z-index: 2;
    padding: 0 20px 20px;
}
.header-card { padding: 20px; }
.action-buttons { display: flex; gap: 10px; }

.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    text-align: center;
}
.cat-item { display: flex; flex-direction: column; align-items: center; gap: 8px; font-size: 12px; }
.cat-icon { width: 54px; height: 54px; background: var(--white); border-radius: 16px; display: flex; align-items: center; justify-content: center; color: var(--emerald); box-shadow: 0 4px 12px rgba(0,0,0,0.04); }
.bazaar-card { display: flex; gap: 12px; padding: 12px; cursor: pointer; }
.bazaar-img { width: 80px; height: 80px; border-radius: 12px; background: url('https://images.unsplash.com/photo-1555939594-58d7cb561ad1?auto=format&fit=crop&q=80&w=200') center/cover; }
.bazaar-info { flex: 1; }
.halal-status {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: rgba(7, 91, 69, 0.06);
    border-radius: 14px;
}

.arabic { font-size: 28px; font-weight: 700; color: var(--emerald); line-height: 1.5; }
.bangla { font-family: 'Noto Sans Bengali', sans-serif; }
.ref { font-size: 12px; color: var(--text-sec); }
.share-row { display: flex; justify-content: center; gap: 18px; font-size: 20px; color: var(--emerald); }

.avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(214, 182, 109, 0.2);
    margin: 0 auto;
    font-size: 32px;
    color: var(--gold);
}
.setting-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    font-weight: 500;
}
.settings-list { margin-top: 12px; }
.lang-switch {
    background: transparent;
    border: none;
    color: var(--emerald);
    font-weight: 600;
    cursor: pointer;
}
.small-btn { font-size: 13px; }

.special-list { margin-top: 12px; }
.special-item {
    display: flex;
    justify-content: space-between;
    padding: 16px 18px;
    background: var(--white);
    border-radius: 14px;
    margin-bottom: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.02);
    cursor: pointer;
}
.detail-card h3 { margin-bottom: 8px; }
.info-list { display: grid; gap: 10px; margin-top: 14px; }

.adhkar-card p { margin-bottom: 10px; }
.counter-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 14px;
}
.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(214, 182, 109, 0.18);
    color: var(--text-pri);
    font-size: 12px;
    font-weight: 600;
}
.status-pill.done {
    background: rgba(7, 91, 69, 0.12);
    color: var(--emerald);
}

.sound-options { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip {
    border: 1px solid rgba(7, 91, 69, 0.2);
    background: transparent;
    color: var(--text-pri);
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 12px;
    cursor: pointer;
}
.chip.active {
    background: var(--emerald);
    border-color: var(--emerald);
    color: var(--white);
}

.toggle {
    width: 42px;
    height: 24px;
    border-radius: 100px;
    background: #d7d7d7;
    position: relative;
    display: inline-block;
    cursor: pointer;
    transition: 0.2s ease;
}
.toggle::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--white);
    top: 3px; left: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.15);
    transition: 0.2s ease;
}
.toggle.active {
    background: var(--emerald);
}
.toggle.active::after { left: 20px; }

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid rgba(0,0,0,0.04);
}
.info-row:last-child { border-bottom: none; }

.calendar-strip {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    flex-wrap: wrap;
}
.day-pill {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: rgba(7, 91, 69, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
}
.day-pill.active {
    background: var(--emerald);
    color: var(--white);
}

.bottom-nav {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: calc(70px + var(--safe-bottom));
    background: var(--white);
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding-bottom: max(var(--safe-bottom), 0px);
    border-top: 1px solid rgba(0,0,0,0.05);
    border-bottom-left-radius: 30px;
    border-bottom-right-radius: 30px;
}
.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 60px;
    min-height: 52px;
    color: var(--text-sec);
    cursor: pointer;
    font-size: 11px;
    user-select: none;
}
.nav-item i { font-size: 18px; }
.nav-item.active { color: var(--emerald); }

@media (min-width: 900px) {
    body {
        padding: 32px;
        background: linear-gradient(135deg, #f0efe8 0%, #dfe4df 100%);
    }

    .device-frame {
        width: min(390px, 72vw);
        height: min(844px, 82vh);
        box-shadow: 0 28px 60px rgba(0,0,0,0.16);
    }
}

@media (max-width: 430px) {
    body {
        padding: 0;
        background: #f0f1ee;
    }

    .device-frame {
        border-radius: 0;
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        padding: 0;
        box-shadow: none;
    }

    .screen-container {
        border-radius: 0;
    }

    .bottom-nav {
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }
}
