:root {
    --bg-dark: #050608;
    --panel-bg: rgba(22, 27, 34, 0.85);
    --gold-primary: #d97706;
    --gold-light: #fbbf24;
    --text-light: #f3f4f6;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Tajawal', sans-serif; }

body {
    background: var(--bg-dark);
    color: var(--text-light);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 20px 10px;
    overflow-x: hidden;
    overflow-y: auto;
    position: relative;
}

#particles-canvas {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 0; pointer-events: none;
}

.page {
    display: none;
    width: 100%;
    max-width: 850px;
    position: relative;
    z-index: 1;
    flex-direction: column;
    align-items: center;
}

.page.active { display: flex; }

header { text-align: center; margin: 10px 0 25px; width: 100%; }
.univ-name { color: var(--gold-light); font-size: 1.3rem; font-weight: bold; letter-spacing: 4px; margin-bottom: 5px; text-transform: uppercase; text-shadow: 0 0 10px rgba(251, 191, 36, 0.3); }
.epic-title { font-family: 'Amiri', serif; font-size: 2.2rem; color: #fff; margin-bottom: 8px; text-shadow: 0 0 15px rgba(255,255,255,0.3); }

.home-grid { 
    display: flex; 
    flex-direction: column;
    gap: 20px;
    align-items: center; 
    width: 100%; 
    margin-top: 15px; 
}

.nav-card {
    background: var(--panel-bg);
    border: 2px solid rgba(251, 191, 36, 0.3);
    border-radius: 20px;
    padding: 28px 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    max-width: 500px;
    width: 100%;
}

.nav-card:hover {
    transform: translateY(-5px);
    border-color: var(--gold-light);
    box-shadow: 0 15px 35px rgba(217, 119, 6, 0.35);
    background: rgba(30, 36, 46, 0.95);
}

.nav-icon { font-size: 3rem; }
.nav-card-title { font-size: 1.4rem; font-weight: 700; color: #fff; }
.nav-card-desc { font-size: 0.95rem; color: #94a3b8; line-height: 1.5; }

.back-btn {
    align-self: flex-start;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 8px 18px;
    border-radius: 30px;
    cursor: pointer;
    margin-bottom: 15px;
    font-weight: bold;
    transition: 0.3s;
}
.back-btn:hover { background: var(--gold-primary); border-color: var(--gold-light); }

.level-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 15px;
    width: 100%;
}

.level-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(251, 191, 36, 0.3);
    color: #fff;
    padding: 10px 18px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    flex: 1;
    min-width: 110px;
    text-align: center;
}

.level-btn.active, .level-btn:hover {
    background: linear-gradient(135deg, #fbbf24, #d97706);
    color: #000;
    border-color: #fbbf24;
    box-shadow: 0 0 12px rgba(251, 191, 36, 0.4);
}

.search-box-card {
    background: var(--panel-bg);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 20px;
    padding: 25px;
    width: 100%;
    margin-bottom: 20px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    position: relative;
}

.search-input-group { 
    display: flex; 
    gap: 10px; 
    margin-top: 15px; 
}

.search-input-wrapper {
    position: relative;
    flex: 1;
}

.search-input {
    background: rgba(0,0,0,0.5);
    border: 1px solid rgba(251,191,36,0.4);
    padding: 14px 18px;
    border-radius: 12px;
    color: #fff;
    font-size: 1.1rem;
    outline: none;
    width: 100%;
}

.index-input-ltr {
    direction: ltr !important;
    text-align: left !important;
    unicode-bidi: isolate !important;
    font-family: 'Rajdhani', 'Orbitron', sans-serif;
    font-weight: bold;
    font-size: 1.2rem;
    letter-spacing: 1px;
}

.search-input:focus { border-color: var(--gold-light); box-shadow: 0 0 10px rgba(251,191,36,0.3); }

.search-btn {
    background: linear-gradient(135deg, #fbbf24, #d97706);
    color: #000;
    border: none;
    padding: 0 25px;
    border-radius: 12px;
    font-weight: bold;
    font-size: 1.1rem;
    cursor: pointer;
    transition: 0.3s;
    white-space: nowrap;
}

.search-btn:hover { background: linear-gradient(135deg, #fcd34d, #f59e0b); }

.suggestions-list {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    background: #0f172a;
    border: 1px solid rgba(251, 191, 36, 0.4);
    border-radius: 12px;
    margin-top: 5px;
    max-height: 220px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 10px 25px rgba(0,0,0,0.8);
}

.suggestion-item {
    padding: 12px 16px;
    color: #f3f4f6;
    cursor: pointer;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    font-size: 1rem;
    transition: background 0.2s;
    text-align: right;
}

.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:hover { background: rgba(251, 191, 36, 0.2); color: #fbbf24; }

.result-wrapper { width: 100%; margin-top: 15px; display: flex; flex-direction: column; gap: 20px; }

.result-sheet-card {
    background: #ffffff;
    color: #1e293b;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    width: 100%;
    direction: ltr;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.sheet-header-box {
    background-color: #e0f2fe;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    margin-bottom: 20px;
}

.sheet-logo {
    font-size: 0.95rem;
    font-weight: bold;
    color: #0f172a;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-bottom: 6px;
}

.sheet-dept {
    font-size: 1.3rem;
    font-weight: bold;
    color: #0284c7;
    margin-bottom: 4px;
}

.sheet-session {
    font-size: 1.1rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 6px;
}

.sheet-student-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: #0f172a;
    direction: rtl;
    font-family: 'Tajawal', sans-serif;
    margin-top: 8px;
}

.sheet-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.sheet-table th, .sheet-table td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.95rem;
}

.sheet-table th {
    font-weight: bold;
    color: #475569;
    background-color: #f8fafc;
}

.sheet-table td:last-child {
    text-align: center;
    font-weight: bold;
}

.grade-pass { color: #16a34a; }
.grade-fail { color: #dc2626; }
.grade-dist { color: #2563eb; }

.tg-card {
    background: rgba(15, 23, 42, 0.95);
    border: 1px solid rgba(56, 189, 248, 0.3);
    border-radius: 16px;
    padding: 20px;
    font-family: 'Tajawal', sans-serif;
    color: #e2e8f0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
    position: relative;
}

.tg-top-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }

.copy-card-btn {
    background: rgba(56, 189, 248, 0.15);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.4);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-card-btn:hover { background: #38bdf8; color: #000; }

.tg-header { color: #38bdf8; font-weight: bold; font-size: 1.2rem; }
.tg-line { border-bottom: 1px solid rgba(255, 255, 255, 0.1); margin: 10px 0; }
.tg-row { display: flex; align-items: center; justify-content: space-between; margin: 10px 0; font-size: 1.05rem; }
.tg-label { color: #94a3b8; display: flex; align-items: center; gap: 8px; }
.tg-val { font-weight: bold; color: #fff; text-align: left; }

.status-msg {
    color: #fbbf24;
    background: rgba(251, 191, 36, 0.1);
    border: 1px solid rgba(251, 191, 36, 0.3);
    padding: 12px;
    border-radius: 10px;
    text-align: center;
    margin-top: 15px;
    width: 100%;
}

.error-msg {
    color: #f87171;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 12px;
    border-radius: 10px;
    text-align: center;
    margin-top: 15px;
    display: none;
    width: 100%;
}

.developer-credit {
    margin-top: 30px; 
    margin-bottom: 20px; 
    font-size: 1rem; 
    color: #94a3b8;
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 8px; 
    width: 100%;
    direction: ltr !important;
    unicode-bidi: bidi-override !important;
}

.dev-name {
    font-family: 'Orbitron', 'Rajdhani', sans-serif; 
    font-weight: 900; 
    font-size: 1.1rem;
    background: linear-gradient(90deg, #f59e0b, #fbbf24, #38bdf8, #f59e0b);
    background-size: 300% auto; 
    -webkit-background-clip: text; 
    -webkit-text-fill-color: transparent;
    animation: devGlow 4s ease infinite;
}

@keyframes devGlow { 
    0% { background-position: 0% center; } 
    50% { background-position: 100% center; } 
    100% { background-position: 0% center; } 
}
