/* ════════════════════════════════════════════════════════════
   GUIDANCE TUTORS - Islamic-themed Mobile-first CSS
   ════════════════════════════════════════════════════════════ */

/* ── Cairo + Tajawal fonts ────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Cairo:wght@400;600;700;900&family=Tajawal:wght@400;500;700;900&display=swap');

/* ════════════════════════════════════════════════════════════
   ✨ Refined Islamic palette — soft, modern, warm
   ════════════════════════════════════════════════════════════ */
:root {
    /* ── Primary brand — vibrant teal-emerald ── */
    --g:        #14805a;
    --g-dark:   #0a4d36;
    --g-light:  #2da775;
    --gp:       #e6f4ec;
    --g-soft:   #f0f9f3;

    /* ── Gold accent — refined royal gold ── */
    --gold:        #c9962a;
    --gold-light:  #e2b94a;
    --gold-dark:   #a47c20;
    --goldp:       #fdf3d4;

    /* ── Status colors (warmer) ── */
    --r:    #d04a3b;
    --rp:   #fdf1ef;
    --b:    #2c6eaa;
    --bp:   #eaf2fa;

    /* ── Neutrals (warm-leaning) ── */
    --gr:   #6c7d76;
    --bg:   #f6f9f7;
    --bd:   #dceee4;
    --wh:   #fff;
    --tx:   #1a2820;

    --pattern-bg: #f3f8f5;

    /* ── Shadows ── */
    --shadow-sm: 0 1px 3px rgba(20,128,90,.07);
    --shadow-md: 0 4px 14px rgba(20,128,90,.10);
    --shadow-lg: 0 8px 28px rgba(20,128,90,.16);
}

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

html, body {
    font-family: 'Cairo', 'Tajawal', sans-serif;
    background: var(--bg);
    color: var(--tx);
    direction: rtl;
    min-height: 100vh;
    -webkit-tap-highlight-color: transparent;
}

body.lang-en { direction: ltr; font-family: 'Cairo', system-ui, sans-serif; }

/* Hide scrollbars on mobile */
::-webkit-scrollbar { width: 0; height: 0; }

input, select, textarea, button {
    font-family: inherit;
}

/* ── Islamic decorative top border ──────────────────────── */
.islamic-pattern {
    background-image:
        repeating-linear-gradient(45deg,
            rgba(201, 150, 42, 0.08) 0,
            rgba(201, 150, 42, 0.08) 2px,
            transparent 2px,
            transparent 8px),
        radial-gradient(circle at 50% 0%, rgba(201, 150, 42, 0.05), transparent 50%);
}

.islamic-divider {
    height: 24px;
    background:
        radial-gradient(circle, var(--gold) 2px, transparent 3px) 0 0 / 16px 24px,
        linear-gradient(to bottom, transparent 45%, var(--gold) 45%, var(--gold) 55%, transparent 55%);
    opacity: 0.4;
}

/* ── Portal screen — modern, warm, premium feel ───────── */
#portal-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background:
        radial-gradient(circle at top right, #1a8d68 0%, transparent 50%),
        radial-gradient(circle at bottom left, #0d6047 0%, transparent 60%),
        linear-gradient(160deg, #0a3d2c, #0f5a40 50%, #14805a 100%);
    padding: 30px 20px;
    gap: 16px;
    position: relative;
    overflow: hidden;
}

#portal-screen::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(circle at 20% 20%, rgba(226, 185, 74, 0.18), transparent 40%),
        radial-gradient(circle at 80% 75%, rgba(226, 185, 74, 0.12), transparent 45%),
        repeating-radial-gradient(circle at 50% 50%, transparent 0, transparent 60px, rgba(226,185,74,0.02) 60px, rgba(226,185,74,0.02) 62px);
    pointer-events: none;
}

.portal-content { position: relative; z-index: 1; max-width: 380px; width: 100%; text-align: center; }

/* اللوجو الحقيقي من موقع الأكاديمية */
.portal-logo {
    width: 220px; height: auto; max-height: 90px; object-fit: contain;
    margin: 0 auto 20px; display: block;
    filter: drop-shadow(0 4px 16px rgba(0,0,0,.4));
    background: rgba(255,255,255,0.95);
    padding: 14px 22px;
    border-radius: 18px;
    border: 1px solid rgba(226, 185, 74, 0.3);
}

.portal-title {
    color: #fff;
    font-size: 24px;
    font-weight: 900;
    margin-bottom: 6px;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
    letter-spacing: 0.3px;
}

.portal-subtitle {
    color: rgba(255, 255, 255, 0.75);
    font-size: 13px;
    margin-bottom: 28px;
    font-weight: 500;
}

.portal-btn {
    width: 100%;
    padding: 17px 16px;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border: 1.5px solid rgba(226, 185, 74, 0.35);
    border-radius: 14px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    margin-bottom: 11px;
    transition: all 0.3s cubic-bezier(.4,0,.2,1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: relative;
    overflow: hidden;
}

.portal-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(226,185,74,0.15), transparent);
    opacity: 0;
    transition: opacity .3s;
}

.portal-btn:hover, .portal-btn:active {
    background: rgba(226, 185, 74, 0.18);
    border-color: var(--gold-light);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(226, 185, 74, 0.18);
}

.portal-btn:hover::before { opacity: 1; }

.portal-btn .icon { font-size: 22px; }

/* ── Login dialog ───────────────────────────────────────── */
.login-overlay {
    position: fixed; inset: 0;
    background: rgba(0, 0, 0, 0.65);
    display: flex; align-items: center; justify-content: center;
    z-index: 999;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.login-box {
    background: var(--wh);
    border-radius: 24px;
    padding: 30px 24px;
    width: 100%;
    max-width: 360px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35), 0 4px 20px rgba(20,128,90,.12);
    border-top: 4px solid var(--gold);
    background-image: linear-gradient(180deg, #fdfbf4 0%, #fff 18%);
}

.login-icon { text-align: center; font-size: 40px; margin-bottom: 10px; }
.login-title { text-align: center; font-weight: 900; font-size: 17px; color: var(--g); margin-bottom: 4px; }
.login-sub { text-align: center; font-size: 12px; color: var(--gr); margin-bottom: 18px; }

.login-input {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--bd);
    border-radius: 12px;
    font-family: inherit;
    font-size: 15px;
    background: var(--bg);
    outline: none;
    transition: border-color 0.2s;
    margin-bottom: 12px;
}

.login-input:focus { border-color: var(--g); background: var(--wh); }

.login-pin {
    text-align: center;
    font-size: 26px;
    letter-spacing: 10px;
    font-weight: 900;
}

.login-select { margin-bottom: 14px; }

.login-err {
    color: var(--r);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    margin-bottom: 10px;
    background: var(--rp);
    border-radius: 8px;
    padding: 8px;
}

.login-buttons { display: flex; gap: 8px; margin-top: 8px; }

.login-buttons button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 12px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 900;
    cursor: pointer;
}

.btn-cancel { background: var(--gr); color: #fff; }
.btn-confirm { background: var(--g); color: #fff; }
.btn-confirm:hover { background: var(--g-dark); }

/* ── Header (after login) — refined ─────────────────────── */
.app-header {
    background:
        linear-gradient(135deg, var(--g) 0%, var(--g-dark) 100%),
        radial-gradient(circle at top right, rgba(226,185,74,.2), transparent 60%);
    color: #fff;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 18px rgba(10, 77, 54, 0.25);
}

.app-header::before {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--gold-light), var(--gold), var(--gold-light), transparent);
}

/* اللوجو الصغير في الـ header */
.app-header-logo {
    height: 32px; width: auto; max-width: 110px;
    object-fit: contain;
    background: rgba(255,255,255,.95);
    padding: 4px 10px;
    border-radius: 8px;
    margin-left: 10px;
}

.hdr-info { display: flex; flex-direction: column; }
.hdr-role { font-size: 10px; opacity: 0.7; }
.hdr-name {
    font-weight: 900;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.hdr-actions { display: flex; gap: 8px; align-items: center; }

.hdr-notif {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    width: 36px; height: 36px;
    color: #fff;
    cursor: pointer;
    font-size: 16px;
    position: relative;
    display: flex; align-items: center; justify-content: center;
}

.hdr-notif-badge {
    position: absolute;
    top: -3px; right: -3px;
    background: var(--r);
    color: #fff;
    border-radius: 99px;
    font-size: 10px;
    font-weight: 900;
    padding: 1px 6px;
    min-width: 16px;
    text-align: center;
}

.hdr-logout {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: #fff;
    padding: 7px 14px;
    font-family: inherit;
    font-size: 12px;
    cursor: pointer;
    font-weight: 700;
}

.task-badge {
    background: var(--r);
    color: #fff;
    border-radius: 20px;
    padding: 2px 8px;
    font-size: 11px;
    font-weight: 900;
}

/* ── Tabs — refined dark green bar ─────────────────────── */
.app-tabs {
    display: flex;
    background: linear-gradient(180deg, var(--g-dark) 0%, #082a1f 100%);
    overflow-x: auto;
    scrollbar-width: none;
    white-space: nowrap;
    position: sticky;
    top: 64px;
    z-index: 99;
    box-shadow: 0 2px 8px rgba(10,77,54,.2);
}

.app-tabs::-webkit-scrollbar { display: none; }

.app-tab {
    flex: 0 0 auto;
    padding: 12px 18px;
    color: rgba(255, 255, 255, 0.6);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: inherit;
    position: relative;
    transition: all 0.25s;
    letter-spacing: 0.2px;
}

.app-tab:hover { color: rgba(255,255,255,.85); background: rgba(255,255,255,.03); }

.app-tab.active {
    color: #fff;
    border-bottom-color: var(--gold-light);
    background: linear-gradient(180deg, rgba(226,185,74,.08) 0%, transparent 100%);
}

.app-tab .badge-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    background: var(--r);
    color: #fff;
    border-radius: 99px;
    width: 16px;
    height: 16px;
    font-size: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
}

/* ── Main content ──────────────────────────────────────── */
.app-main {
    padding: 16px;
    padding-bottom: 60px;
    max-width: 720px;
    margin: 0 auto;
}

/* ── Cards — refined with subtle gradient ───────────────── */
.card {
    background: var(--wh);
    border-radius: 16px;
    padding: 16px 18px;
    margin-bottom: 14px;
    box-shadow: var(--shadow-sm), 0 0 0 1px rgba(20,128,90,.04);
    transition: box-shadow .2s;
    position: relative;
}

.card:hover { box-shadow: var(--shadow-md); }

.card-green  {
    border-right: 4px solid var(--g);
    background: linear-gradient(180deg, var(--g-soft) 0%, #fff 30%);
}
.card-gold   {
    border-right: 4px solid var(--gold);
    background: linear-gradient(180deg, var(--goldp) 0%, #fff 35%);
}
.card-red    {
    border-right: 4px solid var(--r);
    background: linear-gradient(180deg, var(--rp) 0%, #fff 30%);
}
.card-blue   {
    border-right: 4px solid var(--b);
    background: linear-gradient(180deg, var(--bp) 0%, #fff 30%);
}
.card-gray   {
    border-right: 4px solid var(--gr);
    background: linear-gradient(180deg, #f3f5f4 0%, #fff 30%);
}

.card-title {
    font-size: 14px;
    font-weight: 900;
    margin-bottom: 12px;
    color: var(--g-dark);
    letter-spacing: 0.2px;
}

/* ── Forms ─────────────────────────────────────────────── */
.f-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--gr);
    margin-bottom: 5px;
    display: block;
}

.f-input, .f-select, .f-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid var(--bd);
    border-radius: 10px;
    font-family: inherit;
    font-size: 14px;
    color: var(--tx);
    background: var(--wh);
    outline: none;
    transition: border-color 0.2s;
}

.f-input:focus, .f-select:focus, .f-textarea:focus { border-color: var(--g); }

.f-textarea { resize: vertical; min-height: 70px; }

.f-group { margin-bottom: 12px; }

.f-group-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 12px;
}

@media (max-width: 480px) {
    .f-group-2 { grid-template-columns: 1fr; }
}

/* ── Buttons — gradient + lift ──────────────────────────── */
.btn {
    display: inline-block;
    padding: 11px 18px;
    border: none;
    border-radius: 11px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 800;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s cubic-bezier(.4,0,.2,1);
    text-decoration: none;
    color: #fff;
    letter-spacing: 0.2px;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-block { display: block; width: 100%; }
.btn-g    {
    background: linear-gradient(135deg, var(--g), var(--g-dark));
    box-shadow: 0 2px 8px rgba(20,128,90,.25);
}
.btn-g:hover { background: linear-gradient(135deg, var(--g-light), var(--g)); box-shadow: 0 4px 14px rgba(20,128,90,.35); }
.btn-gold {
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    box-shadow: 0 2px 8px rgba(201,150,42,.25);
}
.btn-r    {
    background: linear-gradient(135deg, #e05547, var(--r));
    box-shadow: 0 2px 8px rgba(208,74,59,.25);
}
.btn-b    {
    background: linear-gradient(135deg, #3e80bc, var(--b));
    box-shadow: 0 2px 8px rgba(44,110,170,.25);
}
.btn-gr   {
    background: linear-gradient(135deg, #8c9c95, var(--gr));
    box-shadow: 0 2px 8px rgba(108,125,118,.25);
}
.btn-sm   { padding: 7px 14px; font-size: 12px; border-radius: 9px; }

.btn-outline {
    background: transparent;
    border: 2px solid var(--bd);
    color: var(--gr);
    box-shadow: none;
}
.btn-outline:hover { background: var(--g-soft); border-color: var(--g); color: var(--g); }

/* ── Status pills ──────────────────────────────────────── */
.pill {
    display: inline-block;
    padding: 6px 14px;
    border: 2px solid var(--bd);
    border-radius: 20px;
    background: var(--wh);
    cursor: pointer;
    font-family: inherit;
    font-size: 12px;
    font-weight: 700;
    color: var(--gr);
    margin: 2px;
}

.pill.active { background: var(--g); border-color: var(--g); color: #fff; }
.pill.pill-done   { background: #dcfce7; border-color: #86efac; color: #15803d; }
.pill.pill-abs    { background: #fef9c3; border-color: #fde047; color: #a16207; }
.pill.pill-cancel { background: #fee2e2; border-color: #fca5a5; color: #dc2626; }

/* ── Badge ─────────────────────────────────────────────── */
.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}
.badge-done   { background: #dcfce7; color: #15803d; }
.badge-abs    { background: #fef9c3; color: #a16207; }
.badge-cancel { background: #fee2e2; color: #dc2626; }
.badge-pending { background: #e0e7ff; color: #4338ca; }

/* ── Toast ─────────────────────────────────────────────── */
.toast {
    position: fixed;
    top: 70px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--g);
    color: #fff;
    border-radius: 30px;
    padding: 12px 24px;
    font-weight: 700;
    font-size: 13px;
    z-index: 9999;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
    white-space: nowrap;
    animation: toast-in 0.3s ease-out;
}

@keyframes toast-in {
    from { opacity: 0; transform: translateX(-50%) translateY(-20px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* ── Chat ──────────────────────────────────────────────── */
.chat-container {
    background: var(--wh);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 480px;
}

.chat-header {
    background: linear-gradient(135deg, var(--g), var(--g-dark));
    color: #fff;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chat-header-avatar {
    width: 38px; height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
    font-weight: 900;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 14px;
    background: var(--pattern-bg);
    background-image:
        radial-gradient(circle at 30% 20%, rgba(26,107,60,0.04), transparent 50%),
        radial-gradient(circle at 70% 80%, rgba(201,150,42,0.04), transparent 50%);
}

.chat-bubble {
    max-width: 75%;
    padding: 9px 14px;
    border-radius: 16px;
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.chat-bubble.mine {
    background: var(--g);
    color: #fff;
    margin-left: auto;
    border-bottom-right-radius: 4px;
}

.chat-bubble.theirs {
    background: var(--wh);
    color: var(--tx);
    margin-right: auto;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}

.chat-bubble .meta {
    font-size: 10px;
    opacity: 0.7;
    margin-top: 3px;
}

.chat-bubble .sender-name {
    font-size: 11px;
    font-weight: 900;
    color: var(--gold);
    margin-bottom: 2px;
}

.chat-input {
    padding: 12px;
    background: var(--wh);
    border-top: 1px solid var(--bd);
    display: flex;
    gap: 8px;
}

.chat-input input {
    flex: 1;
    padding: 10px 14px;
    border: 2px solid var(--bd);
    border-radius: 24px;
    font-family: inherit;
    font-size: 14px;
    outline: none;
}

.chat-input input:focus { border-color: var(--g); }

.chat-input button {
    background: var(--g);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    cursor: pointer;
    font-size: 16px;
}

.chat-conv-item {
    background: var(--wh);
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    transition: all 0.15s;
}

.chat-conv-item:hover { background: var(--gp); }

.chat-conv-avatar {
    width: 42px; height: 42px;
    border-radius: 50%;
    background: var(--gp);
    color: var(--g);
    display: flex; align-items: center; justify-content: center;
    font-weight: 900;
    font-size: 16px;
    flex-shrink: 0;
}

.chat-conv-info { flex: 1; min-width: 0; }
.chat-conv-name { font-weight: 900; font-size: 14px; }
.chat-conv-preview { font-size: 12px; color: var(--gr); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-conv-time { font-size: 10px; color: var(--gr); }

.chat-conv-unread {
    background: var(--g);
    color: #fff;
    border-radius: 99px;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    font-size: 11px;
    font-weight: 900;
    display: flex; align-items: center; justify-content: center;
}

/* ── Typing indicator ─────────────────────────────────── */
.chat-bubble.typing-bubble {
    background: rgba(255,255,255,0.85);
    padding: 8px 12px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.typing-dots {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.typing-dots span {
    width: 7px;
    height: 7px;
    background: var(--g);
    border-radius: 50%;
    display: inline-block;
    animation: typing-bounce 1.2s infinite ease-in-out both;
}

.typing-dots span:nth-child(1) { animation-delay: -0.32s; }
.typing-dots span:nth-child(2) { animation-delay: -0.16s; }
.typing-dots span:nth-child(3) { animation-delay: 0; }

@keyframes typing-bounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* ── Rating stars ──────────────────────────────────────── */
.rating-stars { display: inline-flex; gap: 4px; font-size: 24px; cursor: pointer; }
.star { color: #d1d5db; transition: color 0.15s; }
.star.active { color: var(--gold); }
.star:hover { color: var(--gold-light); }

/* ── Loading ───────────────────────────────────────────── */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    gap: 16px;
    direction: rtl;
}

.loading-icon { font-size: 52px; }
.loading-text { color: var(--g); font-weight: 900; font-size: 16px; }

/* ── Misc ──────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-muted  { color: var(--gr); }
.text-bold   { font-weight: 900; }
.text-sm     { font-size: 12px; }

.empty-state {
    text-align: center;
    padding: 40px 0;
    color: var(--gr);
}
.empty-state .emoji { font-size: 44px; margin-bottom: 10px; }

/* ════════════════════════════════════════════════════════════
   STUDENT LOGIN PAGE — Premium Islamic Design
   ════════════════════════════════════════════════════════════ */
#student-login-page {
    min-height: 100vh;
    background:
        radial-gradient(circle at 15% 25%, rgba(226, 185, 74, 0.18), transparent 45%),
        radial-gradient(circle at 85% 75%, rgba(45, 167, 117, 0.25), transparent 50%),
        radial-gradient(circle at 50% 110%, rgba(13, 77, 54, 0.5), transparent 60%),
        linear-gradient(135deg, #051e15 0%, #082c1f 30%, #0d3d2a 60%, #102e22 100%);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    font-family: 'Cairo', 'Tajawal', sans-serif;
}

/* Islamic geometric pattern overlay */
#student-login-page::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(60deg, transparent 0, transparent 35px, rgba(226,185,74,.025) 35px, rgba(226,185,74,.025) 36px),
        repeating-linear-gradient(-60deg, transparent 0, transparent 35px, rgba(226,185,74,.025) 35px, rgba(226,185,74,.025) 36px),
        repeating-linear-gradient(0deg, transparent 0, transparent 35px, rgba(226,185,74,.025) 35px, rgba(226,185,74,.025) 36px);
    pointer-events: none;
}

/* Animated stars */
#student-login-page::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        radial-gradient(2px 2px at 20px 30px, rgba(255,255,255,.4), transparent),
        radial-gradient(2px 2px at 60px 70px, rgba(255,255,255,.3), transparent),
        radial-gradient(1px 1px at 50px 160px, rgba(255,255,255,.4), transparent),
        radial-gradient(2px 2px at 130px 40px, rgba(226,185,74,.6), transparent),
        radial-gradient(1px 1px at 100px 120px, rgba(255,255,255,.5), transparent),
        radial-gradient(2px 2px at 180px 90px, rgba(255,255,255,.4), transparent),
        radial-gradient(2px 2px at 250px 50px, rgba(226,185,74,.4), transparent);
    background-repeat: repeat;
    background-size: 300px 200px;
    animation: stars-twinkle 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes stars-twinkle {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

.student-login-container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 420px;
    animation: fade-in-up 0.7s cubic-bezier(.4,0,.2,1);
}

@keyframes fade-in-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Language switcher */
.lang-switcher {
    position: absolute;
    top: 20px;
    right: 20px;
    display: flex;
    gap: 6px;
    background: rgba(255,255,255,0.1);
    padding: 4px;
    border-radius: 99px;
    backdrop-filter: blur(12px);
    border: 1px solid rgba(226,185,74,0.3);
    z-index: 10;
}

.lang-btn {
    padding: 6px 14px;
    border-radius: 99px;
    border: none;
    background: transparent;
    color: rgba(255,255,255,0.7);
    cursor: pointer;
    font-weight: 700;
    font-size: 12px;
    font-family: inherit;
    transition: all 0.25s;
}

.lang-btn.active {
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
    color: #fff;
    box-shadow: 0 2px 8px rgba(226,185,74,.4);
}

/* Logo section */
.student-login-logo-wrap {
    text-align: center;
    margin-bottom: 28px;
}

.student-login-logo {
    width: 200px;
    height: auto;
    max-height: 80px;
    object-fit: contain;
    background: rgba(255,255,255,0.95);
    padding: 14px 24px;
    border-radius: 20px;
    border: 2px solid rgba(226,185,74,0.4);
    box-shadow: 0 10px 40px rgba(0,0,0,0.5), 0 0 60px rgba(226,185,74,0.15);
    margin-bottom: 18px;
}

.student-welcome-title {
    color: #fff;
    font-size: 28px;
    font-weight: 900;
    margin-bottom: 8px;
    text-shadow: 0 4px 20px rgba(0,0,0,0.4);
    letter-spacing: 0.3px;
}

.student-welcome-subtitle {
    color: rgba(226,185,74,0.9);
    font-size: 14px;
    font-weight: 600;
}

.student-welcome-arabic-greeting {
    font-family: 'Tajawal', 'Cairo', serif;
    font-size: 18px;
    color: rgba(255,255,255,0.85);
    margin: 6px 0 4px;
}

/* Glass card form */
.student-login-card {
    background: rgba(255,255,255,0.10);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1.5px solid rgba(226,185,74,0.25);
    border-radius: 24px;
    padding: 28px 24px;
    box-shadow:
        0 24px 80px rgba(0,0,0,0.5),
        inset 0 1px 0 rgba(255,255,255,0.15);
    color: #fff;
}

.student-form-label {
    display: block;
    color: rgba(255,255,255,0.85);
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

.student-form-input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255,255,255,0.08);
    border: 1.5px solid rgba(255,255,255,0.18);
    border-radius: 14px;
    color: #fff;
    font-family: inherit;
    font-size: 15px;
    outline: none;
    transition: all 0.25s;
    box-sizing: border-box;
}

.student-form-input::placeholder {
    color: rgba(255,255,255,0.4);
}

.student-form-input:focus {
    background: rgba(255,255,255,0.14);
    border-color: var(--gold-light);
    box-shadow: 0 0 0 4px rgba(226,185,74,0.15);
}

.student-form-pin {
    text-align: center;
    font-size: 24px;
    letter-spacing: 12px;
    font-weight: 900;
}

.student-phone-row {
    display: flex;
    gap: 8px;
}

.student-phone-row .student-form-input {
    flex: 1;
}

.student-phone-row select.student-form-input {
    width: 130px;
    flex: 0 0 130px;
    text-align: center;
    background: rgba(255,255,255,0.12);
}

.student-login-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--gold), var(--gold-dark));
    color: #fff;
    border: none;
    border-radius: 14px;
    font-family: inherit;
    font-size: 17px;
    font-weight: 900;
    cursor: pointer;
    margin-top: 8px;
    box-shadow: 0 6px 20px rgba(201,150,42,0.4);
    transition: all 0.25s;
    letter-spacing: 0.5px;
}

.student-login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 28px rgba(201,150,42,0.55);
    background: linear-gradient(135deg, var(--gold-light), var(--gold));
}

.student-login-btn:active { transform: translateY(0); }

.student-login-err {
    background: rgba(192,57,43,0.2);
    border: 1px solid rgba(192,57,43,0.5);
    color: #fbb;
    padding: 10px 12px;
    border-radius: 10px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    margin-bottom: 12px;
}

.student-login-footer {
    text-align: center;
    margin-top: 22px;
    color: rgba(255,255,255,0.55);
    font-size: 12px;
}

.student-login-footer a,
.student-login-footer .link {
    color: var(--gold-light);
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
}

/* Quran verse decoration */
.quran-verse {
    text-align: center;
    color: rgba(226,185,74,0.7);
    font-family: 'Tajawal', serif;
    font-size: 13px;
    line-height: 2;
    margin-top: 20px;
    padding: 12px;
    border-top: 1px solid rgba(226,185,74,0.15);
}

/* Crescent moon decoration */
.crescent-deco {
    position: absolute;
    top: 10%;
    left: 10%;
    font-size: 60px;
    opacity: 0.15;
    animation: floating 6s ease-in-out infinite;
    pointer-events: none;
}

.crescent-deco-2 {
    position: absolute;
    bottom: 12%;
    right: 12%;
    font-size: 50px;
    opacity: 0.1;
    animation: floating 8s ease-in-out infinite reverse;
    pointer-events: none;
}

@keyframes floating {
    0%, 100% { transform: translateY(0) rotate(-5deg); }
    50% { transform: translateY(-20px) rotate(5deg); }
}

/* ════════════════════════════════════════════════════════════
   OLSPARK FOOTER (staff only)
   ════════════════════════════════════════════════════════════ */
.olspark-footer {
    margin: 30px auto 20px;
    padding: 18px 16px 14px;
    text-align: center;
    border-top: 1px solid var(--bd);
    color: var(--gr);
    font-size: 11px;
    max-width: 720px;
}

.olspark-credit {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: linear-gradient(135deg, #fdf3d4, #fff);
    border: 1px solid var(--bd);
    border-radius: 99px;
    font-weight: 700;
    color: var(--g-dark);
    box-shadow: 0 2px 6px rgba(20,128,90,.06);
}

.olspark-credit .spark {
    color: var(--gold);
    font-size: 13px;
    animation: spark-blink 3s ease-in-out infinite;
}

@keyframes spark-blink {
    0%, 100% { opacity: 1; transform: rotate(0); }
    50% { opacity: 0.6; transform: rotate(15deg); }
}

.olspark-tag {
    margin-top: 6px;
    font-size: 10px;
    opacity: 0.65;
}

.flex-row { display: flex; align-items: center; gap: 8px; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.mt-2 { margin-top: 12px; }
.mb-2 { margin-bottom: 12px; }

/* ── Time box ──────────────────────────────────────────── */
.time-box {
    background: linear-gradient(135deg, var(--g), var(--g-dark));
    border-radius: 14px;
    padding: 14px;
    margin: 10px 0;
    color: #fff;
    position: relative;
    overflow: hidden;
}

.time-box::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(201,150,42,0.2), transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(201,150,42,0.15), transparent 40%);
    pointer-events: none;
}

.time-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    position: relative;
    z-index: 1;
}

.time-row:not(:last-child) { border-bottom: 1px solid rgba(255,255,255,0.15); }

.time-flag  { font-size: 11px; opacity: 0.75; margin-bottom: 2px; }
.time-val   { font-size: 20px; font-weight: 900; font-variant-numeric: tabular-nums; }
.time-arrow { font-size: 20px; opacity: 0.6; }

/* ════════════════════════════════════════════════════════════
   SESSION COUNTDOWN
   ════════════════════════════════════════════════════════════ */
.countdown-card {
    background: linear-gradient(135deg, var(--g), var(--g-dark));
    color: #fff;
    border-radius: 16px;
    padding: 20px;
    text-align: center;
    margin: 12px 0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(26, 107, 60, 0.25);
}

.countdown-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(201,150,42,0.25), transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(201,150,42,0.15), transparent 50%);
    pointer-events: none;
}

.countdown-card > * { position: relative; z-index: 1; }

.countdown-label {
    font-size: 12px;
    opacity: 0.85;
    margin-bottom: 8px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.countdown-digits {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    font-variant-numeric: tabular-nums;
    margin: 4px 0;
}

.countdown-unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 56px;
    background: rgba(255,255,255,0.12);
    padding: 8px 10px;
    border-radius: 10px;
    backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.18);
}

.countdown-num {
    font-size: 28px;
    font-weight: 900;
    line-height: 1;
    color: #fff;
}

.countdown-unit-label {
    font-size: 10px;
    opacity: 0.75;
    margin-top: 4px;
    font-weight: 600;
}

.countdown-colon {
    font-size: 28px;
    font-weight: 900;
    color: var(--gold);
    margin-top: -16px;
}

/* ── Join button (when session is about to start or running) ─── */
.join-session-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: #fff;
    border: none;
    border-radius: 14px;
    font-family: 'Cairo', sans-serif;
    font-size: 17px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
    margin: 12px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    transition: transform 0.15s;
}

.join-session-btn:hover {
    transform: translateY(-2px);
}

.join-session-btn:active {
    transform: translateY(0);
}

.join-session-btn.pulsing {
    animation: pulse-glow 1.8s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 8px 30px rgba(37, 211, 102, 0.7), 0 0 0 6px rgba(37, 211, 102, 0.15);
        transform: scale(1.02);
    }
}

.join-session-btn .icon {
    font-size: 22px;
}

.session-live-bar {
    background: linear-gradient(135deg, #ff6b6b, #c0392b);
    color: #fff;
    border-radius: 12px;
    padding: 10px 14px;
    font-weight: 900;
    font-size: 13px;
    text-align: center;
    margin-bottom: 10px;
    animation: live-pulse 2s ease-in-out infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

@keyframes live-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.live-dot {
    width: 10px;
    height: 10px;
    background: #fff;
    border-radius: 50%;
    animation: dot-blink 1s ease-in-out infinite;
}

@keyframes dot-blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.3; }
}

.session-ended-msg {
    background: var(--gr);
    color: #fff;
    border-radius: 10px;
    padding: 10px 14px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    margin: 10px 0;
    opacity: 0.7;
}

/* ── End session prompt for teacher ─────────────────────── */
.end-session-prompt {
    background: linear-gradient(135deg, #fef9c3, #fde68a);
    border: 2px solid var(--gold);
    border-radius: 12px;
    padding: 14px;
    margin: 10px 0;
    animation: gentle-pulse 2.5s ease-in-out infinite;
}

@keyframes gentle-pulse {
    0%, 100% { box-shadow: 0 2px 10px rgba(201,150,42,.2); }
    50% { box-shadow: 0 4px 20px rgba(201,150,42,.5); }
}

.end-session-prompt-title {
    color: #7a5a0a;
    font-weight: 900;
    font-size: 14px;
    margin-bottom: 10px;
    text-align: center;
}

.end-session-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.end-session-btn {
    padding: 12px 8px;
    border: none;
    border-radius: 10px;
    font-family: 'Cairo', sans-serif;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    text-align: center;
    color: #fff;
    transition: transform 0.15s;
}

.end-session-btn:hover {
    transform: translateY(-2px);
}

.end-btn-present  { background: linear-gradient(135deg, #1a6b3c, #2d9e5f); }
.end-btn-abs-paid { background: linear-gradient(135deg, #c9962a, #d4a83f); }
.end-btn-abs-unpaid { background: linear-gradient(135deg, #c0392b, #e74c3c); }
.end-btn-cancel   { background: linear-gradient(135deg, #6b7280, #9ca3af); }

.no-zoom-warning {
    background: var(--rp);
    color: var(--r);
    border-radius: 10px;
    padding: 10px;
    text-align: center;
    font-size: 12px;
    font-weight: 700;
    margin: 8px 0;
    border: 1px dashed var(--r);
}
