:root {
    --bg-light: #F8F9FD;
    --card-white: #ffffff;
    --text-main: #2D3436;
    --accent-blue: #4A90E2;
    --accent-soft: #EDF2F7;
    --shadow-subtle: 0 10px 25px rgba(0, 0, 0, 0.05);
}

body, html {
    margin: 0;
    padding: 0;
    height: 100%;
    background-color: var(--bg-light);
    font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    color: var(--text-main);
}

/* App Wrapper occupies full mobile screen */
.app-wrapper {
    max-width: 500px; /* Limit for desktop viewing, full on mobile */
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--bg-light);
    position: relative;
    padding-bottom: 85px; /* Space for fixed tab bar */
}

/* Header & User Card */
.user-profile-card {
    background: var(--card-white);
    border-radius: 16px;
    box-shadow: var(--shadow-subtle);
}

.avatar-circle {
    width: 45px;
    height: 45px;
    background: var(--accent-soft);
    color: var(--accent-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
}

.btn-add-modern {
    background: var(--text-main);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
}

/* Stats Styling */
.stat-box {
    background: var(--card-white);
    padding: 15px 5px;
    border-radius: 16px;
    text-align: center;
    box-shadow: var(--shadow-subtle);
    display: flex;
    flex-direction: column;
}

.stat-val {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--accent-blue);
}

.stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #A0AEC0;
}

/* Carousel & Promo Cards */
.promo-modern {
    width: 85%;
    background: var(--card-white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow-subtle);
    margin-bottom: 10px;
}

.promo-accent {
    height: 6px;
    width: 100%;
}
.accent-1 { background: #4A90E2; }
.accent-2 { background: #6366F1; }
.accent-3 { background: #10B981; }
.accent-4 { background: #20B981; }
.accent-5 { background: #30B981; }

.btn-modern-dark {
    background: var(--text-main);
    color: white;
    border-radius: 8px;
    border: none;
}

.btn-modern-outline {
    background: transparent;
    border: 1px solid #E2E8F0;
    color: var(--text-main);
    border-radius: 8px;
}

.carousel-indicators [data-bs-target] {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #CBD5E0;
}

.carousel-indicators .active {
    background-color: var(--accent-blue);
    width: 20px;
    border-radius: 10px;
}

/* Bottom Tab Bar */
.tab-bar {
    background: var(--card-white);
    height: 70px;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding-bottom: env(safe-area-inset-bottom);
    border-top: 1px solid #edf2f7;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    max-width: 500px;
    margin: 0 auto;
    z-index: 1030;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
}

.tab-link {
    text-decoration: none;
    color: #A0AEC0;
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 0.65rem;
    gap: 4px;
}

.tab-link i {
    font-size: 1.2rem;
}

.tab-link.active {
    color: var(--accent-blue);
}

/* Tab Content */
.tab-content {
    flex-grow: 1;
}

.tab-content.active {
    display: block;
}

/* Useful Link Cards */
.useful-link-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.useful-link-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2) !important;
}

.useful-link-card:active {
    transform: translateY(0);
}

/* Schedule List */
.schedule-item {
    transition: background-color 0.2s ease;
}

.schedule-item:hover {
    background-color: #f8f9fa;
}

.schedule-time {
    border-right: 2px solid #667eea;
    padding-right: 12px;
}

/* Video Container - Responsive */
.video-container {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    background: #000;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 16px;
}

/* Quran Tilawat Cards */
.quran-card {
    background: var(--card-white);
    border-radius: 16px;
    box-shadow: var(--shadow-subtle);
    margin-bottom: 12px;
    overflow: hidden;
}

.quran-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.15s ease;
}

.quran-card-header:active {
    background-color: #f0f4f8;
}

.quran-card-header .quran-title {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text-main);
}

.quran-card-header .chevron-icon {
    color: #A0AEC0;
    transition: transform 0.25s ease;
    font-size: 0.85rem;
}

.quran-card-header .chevron-icon.expanded {
    transform: rotate(180deg);
}

.quran-card-progress {
    height: 3px;
    background: #EDF2F7;
}

.quran-card-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #10B981, #34D399);
    transition: width 0.3s ease;
    border-radius: 0 3px 3px 0;
}

.quran-card-progress-bar.complete {
    background: linear-gradient(90deg, #f59e0b, #f97316);
}

.quran-card-body {
    padding: 12px 16px 16px;
    display: none;
}

.quran-card-body.show {
    display: block;
}

.sipara-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 8px;
}

.sipara-box {
    aspect-ratio: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    border: 2px solid #E2E8F0;
    color: #718096;
    background: #F7FAFC;
    transition: all 0.15s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.sipara-box:active {
    transform: scale(0.92);
}

.sipara-box.done {
    background: linear-gradient(135deg, #10B981 0%, #34D399 100%);
    color: white;
    border-color: #10B981;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.quran-card-footer {
    padding: 0 16px 12px;
    display: none;
    text-align: right;
}

.quran-card-body.show + .quran-card-footer {
    display: block;
}

.btn-delete-quran {
    background: none;
    border: none;
    color: #E53E3E;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 8px;
    transition: background 0.15s;
}

.btn-delete-quran:hover {
    background: #FFF5F5;
}

/* Talim Table */
@font-face {
    font-family: 'kanzalmarjan';
    src: url('marjan/kanz-al-marjaan-webfont.ttf');
}

.talim-table td,
.talim-table th {
    font-family: 'kanzalmarjan', sans-serif;
    font-size: 14px;
    vertical-align: middle;
    padding: 8px 6px;
}