/* ===== ISLAMIC NEW GEN THEME ===== */
:root {
    --green-deep:   #0D3D2A;
    --green-mid:    #1B6B4A;
    --green-light:  #2A9D6F;
    --gold:         #C9A84C;
    --gold-light:   #E8C96A;
    --cream:        #F8F4EF;
    --cream-dark:   #EDE8E0;
    --brown:        #5C3A1E;
    --text-dark:    #1A1A1A;
    --text-muted:   #6B6560;
    --white:        #FFFFFF;
    --shadow-sm:    0 2px 12px rgba(13,61,42,0.10);
    --shadow-md:    0 6px 24px rgba(13,61,42,0.15);
    --shadow-lg:    0 16px 48px rgba(13,61,42,0.20);
    --radius:       16px;
    --radius-sm:    10px;
}

/* ===== RESET & BASE ===== */
html { font-size: 16px; }
body {
    background: var(--cream);
    color: var(--text-dark);
    font-family: 'Segoe UI', system-ui, sans-serif;
    margin-bottom: 0;
}

/* ===== ISLAMIC PATTERN BACKGROUND ===== */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 20%, rgba(27,107,74,0.04) 0%, transparent 60%),
        radial-gradient(circle at 80% 80%, rgba(201,168,76,0.04) 0%, transparent 60%);
    pointer-events: none;
    z-index: 0;
}

/* ===== NAVBAR ===== */
.navbar {
    background: linear-gradient(135deg, var(--green-deep) 0%, var(--green-mid) 100%) !important;
    border-bottom: 3px solid var(--gold) !important;
    box-shadow: var(--shadow-md);
    padding: 0.6rem 1rem;
}
.navbar-brand {
    color: var(--gold) !important;
    font-family: 'Amiri', serif;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.navbar-brand::before {
    content: '☪';
    font-size: 1.3rem;
    color: var(--gold-light);
}
.nav-link {
    color: rgba(255,255,255,0.85) !important;
    font-weight: 500;
    transition: color 0.2s;
    padding: 0.4rem 0.9rem !important;
    border-radius: var(--radius-sm);
}
.nav-link:hover { color: var(--gold-light) !important; background: rgba(255,255,255,0.08); }
.nav-link.text-danger { color: #FF8080 !important; }
.navbar-toggler { border-color: var(--gold) !important; }
.navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23C9A84C' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e") !important;
}

/* ===== LANGUAGE SELECTOR ===== */
.dropdown-menu {
    border: 1px solid var(--cream-dark);
    box-shadow: var(--shadow-md);
    border-radius: var(--radius-sm);
}

/* ===== CONTAINER ===== */
.container { position: relative; z-index: 1; }

/* ===== HERO SECTION ===== */
.hero-section {
    background: linear-gradient(160deg, var(--green-deep) 0%, var(--green-mid) 50%, var(--green-light) 100%);
    border-radius: var(--radius);
    padding: 3rem 2rem;
    text-align: center;
    color: var(--white);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}
.hero-section::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.4;
    pointer-events: none;
}
.hero-section .basmala {
    font-family: 'Amiri', 'Traditional Arabic', serif;
    font-size: 2.2rem;
    color: var(--gold-light);
    direction: rtl;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.hero-section h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 0.5rem;
}
.hero-section .subtitle {
    color: rgba(255,255,255,0.75);
    font-size: 1rem;
    margin-bottom: 1.5rem;
}
.hero-ayah {
    font-family: 'Amiri', serif;
    font-size: 1.4rem;
    color: var(--gold-light);
    direction: rtl;
    font-style: normal;
    background: rgba(255,255,255,0.08);
    border-radius: var(--radius-sm);
    padding: 0.8rem 1.5rem;
    display: inline-block;
    margin-top: 0.5rem;
    border: 1px solid rgba(201,168,76,0.3);
}

/* ===== STATS BAR ===== */
.stats-bar {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}
.stat-pill {
    background: var(--white);
    border: 2px solid var(--cream-dark);
    border-radius: 50px;
    padding: 0.5rem 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--green-mid);
    box-shadow: var(--shadow-sm);
    cursor: default;
    transition: transform 0.2s, box-shadow 0.2s;
}
.stat-pill:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.stat-pill .icon { font-size: 1.1rem; }
.stat-pill .count { color: var(--gold); font-size: 1.1rem; }

/* ===== CATEGORY FILTER ===== */
.filter-row { margin-bottom: 2rem; }
.filter-row .btn-group { gap: 0.5rem; display: flex; flex-wrap: wrap; justify-content: center; }
.btn-filter {
    border: 2px solid var(--green-mid);
    color: var(--green-mid);
    background: var(--white);
    border-radius: 50px !important;
    padding: 0.4rem 1.2rem;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.2s;
    box-shadow: var(--shadow-sm);
}
.btn-filter:hover, .btn-filter.active {
    background: var(--green-mid);
    color: var(--white);
    border-color: var(--green-mid);
    box-shadow: var(--shadow-md);
}
.btn-filter.active { background: var(--green-deep); border-color: var(--green-deep); }

/* ===== DHIKR CARDS ===== */
.dhikr-card {
    border: none;
    border-radius: var(--radius) !important;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    background: var(--white);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}
.dhikr-card::after {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--gold), var(--gold-light), var(--gold));
}
.dhikr-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg) !important;
}
.card-header-islamic {
    background: linear-gradient(135deg, var(--green-deep) 0%, var(--green-mid) 100%);
    color: var(--white);
    padding: 1.1rem 1.2rem;
    border: none;
}
.card-header-islamic .card-title { font-size: 1rem; font-weight: 700; margin-bottom: 0.3rem; }
.card-header-islamic .badge-cat {
    background: rgba(255,255,255,0.18);
    color: var(--gold-light);
    border: 1px solid rgba(201,168,76,0.4);
    border-radius: 50px;
    padding: 0.2rem 0.7rem;
    font-size: 0.75rem;
    font-weight: 600;
}
.arabic-text-card {
    font-family: 'Amiri', 'Traditional Arabic', serif;
    font-size: 1.6rem;
    line-height: 2;
    color: var(--green-deep);
    direction: rtl;
    text-align: right;
    padding: 1rem;
    background: linear-gradient(135deg, var(--cream) 0%, rgba(27,107,74,0.04) 100%);
    border-radius: var(--radius-sm);
    margin-bottom: 0.8rem;
    border-right: 3px solid var(--gold);
}
.translation-box {
    background: var(--cream);
    border-radius: var(--radius-sm);
    padding: 0.7rem 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: italic;
    margin-bottom: 0.8rem;
    border-left: 3px solid var(--green-light);
}
.rep-badge {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    color: var(--green-deep);
    border-radius: 50px;
    padding: 0.35rem 1rem;
    font-weight: 700;
    font-size: 0.85rem;
    box-shadow: 0 2px 8px rgba(201,168,76,0.3);
}
.btn-recite {
    background: linear-gradient(135deg, var(--green-mid) 0%, var(--green-light) 100%);
    color: var(--white);
    border: none;
    border-radius: 50px;
    padding: 0.35rem 1.1rem;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(27,107,74,0.3);
}
.btn-recite:hover {
    background: linear-gradient(135deg, var(--green-deep) 0%, var(--green-mid) 100%);
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(27,107,74,0.4);
}
.btn-view {
    color: var(--green-mid);
    border: 1.5px solid var(--green-mid);
    border-radius: 50px;
    padding: 0.35rem 1rem;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
}
.btn-view:hover { background: var(--green-mid); color: var(--white); }

/* ===== MINI COUNTER ON CARD ===== */
.mini-counter {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--cream);
    border-radius: var(--radius-sm);
    padding: 0.5rem 0.8rem;
    margin-bottom: 0.8rem;
}
.mini-counter .count-display {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--green-deep);
    min-width: 2.5rem;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.mini-counter .btn-tap {
    width: 44px; height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--green-mid), var(--green-light));
    color: var(--white);
    border: none;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(27,107,74,0.35);
    transition: transform 0.1s, box-shadow 0.1s;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700;
    flex-shrink: 0;
}
.mini-counter .btn-tap:active { transform: scale(0.88); box-shadow: 0 1px 4px rgba(27,107,74,0.2); }
.mini-counter .btn-reset {
    background: none; border: none; color: var(--text-muted); font-size: 0.75rem;
    cursor: pointer; padding: 0; text-decoration: underline;
}
.mini-counter .btn-reset:hover { color: var(--brown); }
.progress-mini {
    height: 5px;
    border-radius: 3px;
    background: var(--cream-dark);
    margin-top: 0.4rem;
    overflow: hidden;
}
.progress-mini .bar {
    height: 100%;
    background: linear-gradient(90deg, var(--green-mid), var(--gold));
    border-radius: 3px;
    transition: width 0.3s ease;
}

/* ===== DETAILS PAGE ===== */
.detail-hero {
    background: linear-gradient(160deg, var(--green-deep) 0%, var(--green-mid) 100%);
    border-radius: var(--radius) var(--radius) 0 0;
    padding: 2.5rem 2rem;
    text-align: center;
    color: var(--white);
    position: relative;
    overflow: hidden;
}
.detail-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.04' fill-rule='evenodd'%3E%3Cpath d='M0 40L40 0H20L0 20M40 40V20L20 40'/%3E%3C/g%3E%3C/svg%3E");
}
.detail-hero h2 { font-size: 1.6rem; font-weight: 700; margin-bottom: 0.4rem; }
.detail-hero .cat-badge {
    background: var(--gold);
    color: var(--green-deep);
    border-radius: 50px;
    padding: 0.25rem 0.9rem;
    font-weight: 700;
    font-size: 0.8rem;
}
.arabic-big {
    font-family: 'Amiri', 'Traditional Arabic', serif;
    font-size: 2.2rem;
    line-height: 2.2;
    direction: rtl;
    text-align: center;
    color: var(--green-deep);
    padding: 2rem;
    background: linear-gradient(135deg, rgba(27,107,74,0.05) 0%, rgba(201,168,76,0.06) 100%);
    border-radius: var(--radius);
    border: 1px solid rgba(201,168,76,0.2);
    box-shadow: inset 0 2px 12px rgba(27,107,74,0.06);
}
.lang-section {
    background: var(--white);
    border-radius: var(--radius-sm);
    padding: 1.5rem;
    border: 1px solid var(--cream-dark);
    height: 100%;
}
.lang-section h5 {
    color: var(--green-mid);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
    margin-bottom: 1rem;
    border-bottom: 2px solid var(--gold);
    padding-bottom: 0.5rem;
}

/* ===== COUNTER SECTION ===== */
.counter-section {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow-md);
    border: 2px solid var(--cream-dark);
    margin-top: 1.5rem;
}
.counter-section h3 {
    color: var(--green-deep);
    font-weight: 700;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
.goal-selector { display: flex; gap: 0.5rem; flex-wrap: wrap; justify-content: center; margin-bottom: 1.5rem; }
.btn-goal {
    border: 2px solid var(--cream-dark);
    background: var(--cream);
    color: var(--text-dark);
    border-radius: 50px;
    padding: 0.4rem 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}
.btn-goal:hover, .btn-goal.active {
    border-color: var(--gold);
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    color: var(--green-deep);
    box-shadow: 0 2px 10px rgba(201,168,76,0.3);
}
.progress-ring-container {
    display: flex;
    justify-content: center;
    margin: 1.5rem 0;
    position: relative;
}
.progress-ring-container svg { transform: rotate(-90deg); }
.ring-bg { fill: none; stroke: var(--cream-dark); stroke-width: 12; }
.ring-progress {
    fill: none;
    stroke: url(#ringGrad);
    stroke-width: 12;
    stroke-linecap: round;
    transition: stroke-dashoffset 0.4s ease;
}
.ring-center-text {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
.ring-count { font-size: 2.8rem; font-weight: 900; color: var(--green-deep); line-height: 1; }
.ring-goal { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.2rem; }
.btn-big-tap {
    width: 90px; height: 90px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--green-mid) 0%, var(--green-light) 100%);
    color: var(--white);
    border: none;
    font-size: 2rem;
    cursor: pointer;
    box-shadow: 0 6px 24px rgba(27,107,74,0.4);
    transition: transform 0.1s, box-shadow 0.1s;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 1rem;
    font-weight: 700;
}
.btn-big-tap:active { transform: scale(0.88); box-shadow: 0 2px 8px rgba(27,107,74,0.2); }
.btn-big-tap.pulse { animation: tapPulse 0.3s ease; }
@keyframes tapPulse {
    0%   { transform: scale(1); }
    50%  { transform: scale(0.88); }
    100% { transform: scale(1); }
}
.counter-controls {
    display: flex; gap: 0.7rem; justify-content: center; flex-wrap: wrap; margin-top: 1rem;
}
.btn-ctrl {
    background: var(--cream);
    border: 2px solid var(--cream-dark);
    color: var(--text-dark);
    border-radius: 50px;
    padding: 0.4rem 1.2rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-ctrl:hover { border-color: var(--green-mid); color: var(--green-mid); }
.btn-ctrl.danger:hover { border-color: #dc3545; color: #dc3545; }
.completion-banner {
    display: none;
    background: linear-gradient(135deg, var(--green-mid) 0%, var(--green-light) 100%);
    color: var(--white);
    border-radius: var(--radius-sm);
    padding: 1rem 1.5rem;
    text-align: center;
    margin-top: 1rem;
    font-weight: 600;
    animation: slideIn 0.4s ease;
    box-shadow: var(--shadow-md);
}
.completion-banner .banner-arabic {
    font-family: 'Amiri', serif;
    font-size: 1.4rem;
    direction: rtl;
    display: block;
    color: var(--gold-light);
    margin-top: 0.3rem;
}
@keyframes slideIn {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ===== CHALLENGE SECTION ===== */
.challenge-section {
    background: linear-gradient(135deg, var(--green-deep) 0%, #0F4D34 100%);
    border-radius: var(--radius);
    padding: 1.5rem;
    color: var(--white);
    margin-top: 1.5rem;
    box-shadow: var(--shadow-md);
}
.challenge-section h4 {
    color: var(--gold-light);
    font-weight: 700;
    font-size: 1rem;
    display: flex; align-items: center; gap: 0.5rem;
    margin-bottom: 1rem;
}
.challenge-card {
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(201,168,76,0.25);
    border-radius: var(--radius-sm);
    padding: 1rem;
    margin-bottom: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: background 0.2s;
}
.challenge-card:hover { background: rgba(255,255,255,0.12); }
.challenge-info .name { font-weight: 600; font-size: 0.95rem; }
.challenge-info .target { font-size: 0.8rem; color: rgba(255,255,255,0.65); margin-top: 0.2rem; }
.challenge-progress { display: flex; align-items: center; gap: 0.7rem; }
.challenge-progress .progress-ring-mini { width: 40px; height: 40px; position: relative; }
.challenge-progress .progress-ring-mini svg { transform: rotate(-90deg); }
.challenge-done {
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    color: var(--green-deep);
    border-radius: 50px;
    padding: 0.2rem 0.8rem;
    font-size: 0.75rem;
    font-weight: 700;
}
.streak-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 100%);
    color: var(--green-deep);
    border-radius: 50px;
    padding: 0.4rem 1rem;
    font-weight: 700;
    font-size: 0.9rem;
    box-shadow: 0 2px 8px rgba(201,168,76,0.3);
}

/* ===== FOOTER ===== */
footer.footer {
    background: var(--green-deep) !important;
    color: rgba(255,255,255,0.75) !important;
    border-top: 3px solid var(--gold) !important;
    padding: 1.2rem 0;
    margin-top: 3rem;
}
footer .footer-arabic {
    font-family: 'Amiri', serif;
    font-size: 1.1rem;
    color: var(--gold-light);
    direction: rtl;
}
footer a { color: var(--gold-light) !important; }

/* ===== BACK BUTTON ===== */
.btn-back {
    background: var(--white);
    border: 2px solid var(--green-mid);
    color: var(--green-mid);
    border-radius: 50px;
    padding: 0.4rem 1.2rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.btn-back:hover { background: var(--green-mid); color: var(--white); }

/* ===== ADMIN PANEL ===== */
.admin-table { background: var(--white); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.admin-table thead { background: var(--green-deep); color: var(--white); }

/* ===== FORMS ===== */
.form-control:focus {
    border-color: var(--green-mid);
    box-shadow: 0 0 0 0.2rem rgba(27,107,74,0.2);
}
.btn-primary {
    background: linear-gradient(135deg, var(--green-mid) 0%, var(--green-light) 100%);
    border: none;
    border-radius: 50px;
    padding: 0.5rem 1.8rem;
    font-weight: 600;
}
.btn-primary:hover { background: linear-gradient(135deg, var(--green-deep) 0%, var(--green-mid) 100%); }

/* ===== LOGIN PAGE ===== */
.login-card {
    max-width: 420px;
    margin: 3rem auto;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}
.login-card .login-header {
    background: linear-gradient(135deg, var(--green-deep) 0%, var(--green-mid) 100%);
    padding: 2rem;
    text-align: center;
    color: var(--white);
    border-bottom: 3px solid var(--gold);
}
.login-card .login-header h2 {
    font-family: 'Amiri', serif;
    color: var(--gold-light);
    font-size: 1.8rem;
    margin-bottom: 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 576px) {
    .hero-section { padding: 2rem 1rem; }
    .hero-section h1 { font-size: 1.4rem; }
    .hero-section .basmala { font-size: 1.6rem; }
    .arabic-big { font-size: 1.5rem; padding: 1.2rem; }
    .ring-count { font-size: 2.2rem; }
    .btn-big-tap { width: 75px; height: 75px; font-size: 1.6rem; }
}

/* ===== ARABIC FONT LOADING ===== */
@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400&display=swap');
