/* ==========================================================================
   المكتبة الرقمية لجامعة جدارا | نظام التصميم الفاخر (Jadara Portal Stylesheet)
   ========================================================================== */

:root {
    --font-primary: 'Cairo', 'Tajawal', sans-serif;
    --font-heading: 'Cairo', sans-serif;
    --transition-smooth: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    
    /* أنظمة ألوان الوضع الداكن الفاخر (Slate-Midnight Theme) */
    --bg-main: radial-gradient(circle at 10% 20%, #0c0e17 0%, #030408 90%);
    --bg-panel: rgba(16, 20, 35, 0.55);
    --bg-card: rgba(30, 41, 59, 0.35);
    --bg-input: rgba(11, 15, 26, 0.7);
    --border-color: rgba(255, 255, 255, 0.06);
    --border-hover: rgba(59, 130, 246, 0.45);
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #5e6f85;
    
    --primary: #3b82f6;
    --primary-glow: rgba(59, 130, 246, 0.25);
    --accent: #f59e0b;
    --accent-glow: rgba(245, 158, 11, 0.2);
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.15);
    
    --card-shadow: 0 10px 40px -10px rgba(0, 0, 0, 0.6);
    --blur-intensity: 22px;
}

/* سمات الوضع الفاتح المريح للعين (Soft-Light Theme) */
[data-theme="light"] {
    --bg-main: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%);
    --bg-panel: rgba(255, 255, 255, 0.75);
    --bg-card: rgba(255, 255, 255, 0.9);
    --bg-input: rgba(235, 241, 247, 0.8);
    --border-color: rgba(15, 23, 42, 0.08);
    --border-hover: rgba(37, 99, 235, 0.3);
    
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    
    --primary: #2563eb;
    --primary-glow: rgba(37, 99, 235, 0.15);
    --accent: #d97706;
    --accent-glow: rgba(217, 119, 6, 0.15);
    --success: #059669;
    --success-glow: rgba(5, 150, 105, 0.12);
    
    --card-shadow: 0 10px 30px -10px rgba(15, 23, 42, 0.06);
}

/* التنسيقات العامة وإعادة التعيين */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-primary);
    scrollbar-width: thin;
    scrollbar-color: var(--primary) transparent;
}

.visually-hidden-control {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.switch-container:focus-within #master-switch-bg {
    outline: 3px solid rgba(96, 165, 250, 0.55);
    outline-offset: 3px;
}

.book-card.shared-target {
    border-color: #60a5fa;
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.2), var(--card-shadow);
    animation: sharedBookPulse 1.8s ease-out;
}

@keyframes sharedBookPulse {
    0% { transform: scale(0.98); }
    45% { transform: scale(1.015); }
    100% { transform: scale(1); }
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
    opacity: 0.5;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--accent);
}

html,
body {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
}

body {
    background: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    direction: rtl;
    overflow-x: hidden;
    line-height: 1.6;
    transition: background 0.5s ease, color 0.5s ease;
}

/* بنية التطبيق الرئيسية */
.app-container {
    opacity: 0;
    transition: opacity 0.8s ease;
    width: 100%;
    max-width: 100%;
    max-width: 1350px;
    margin: 0 auto;
    padding: 24px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-container.visible {
    opacity: 1;
}

/* رأس الصفحة (Header Card) */
header {
    background: var(--bg-panel);
    backdrop-filter: blur(var(--blur-intensity));
    border: 1px solid var(--border-color);
    padding: 16px 28px;
    border-radius: 22px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    box-shadow: var(--card-shadow);
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
}

.brand-icon {
    font-size: 34px;
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.brand-info h2 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 900;
    margin: 0;
}

.brand-info p {
    font-size: 0.76rem;
    color: var(--text-secondary);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-toggle {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.1rem;
    transition: var(--transition-smooth);
    color: var(--text-primary);
}

.theme-toggle:hover {
    border-color: var(--primary);
    transform: scale(1.04);
    background: var(--bg-panel);
}

/* ==========================================================================
   1. شاشة البوابة الرئيسية (Portal Layout)
   ========================================================================== */
.portal-view {
    display: flex;
    flex-direction: column;
    gap: 24px;
    animation: fadeIn 0.5s ease;
}

/* الغلاف البانورامي للموقع */
.portal-banner {
    position: relative;
    width: 100%;
    min-height: 380px;
    border-radius: 28px;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: 40px;
    box-shadow: var(--card-shadow);
}

.banner-slideshow {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 0;
}

.slide.active {
    opacity: 1;
    z-index: 1;
}

/* حركة طيران الدرون لصور الجامعة السبعة */
.slide.active:nth-child(1) {
    animation: droneFlight1 6.2s linear forwards;
}
.slide.active:nth-child(2) {
    animation: droneFlight2 6.2s linear forwards;
}
.slide.active:nth-child(3) {
    animation: droneFlight3 6.2s linear forwards;
}
.slide.active:nth-child(4) {
    animation: droneFlight4 6.2s linear forwards;
}
.slide.active:nth-child(5) {
    animation: droneFlight5 6.2s linear forwards;
}
.slide.active:nth-child(6) {
    animation: droneFlight6 6.2s linear forwards;
}
.slide.active:nth-child(7) {
    animation: droneFlight7 6.2s linear forwards;
}

@keyframes droneFlight1 {
    0% { transform: scale(1.04) translate(0, 0); }
    100% { transform: scale(1.15) translate(15px, 8px); }
}
@keyframes droneFlight2 {
    0% { transform: scale(1.15) translate(-10px, 5px); }
    100% { transform: scale(1.04) translate(0, 0); }
}
@keyframes droneFlight3 {
    0% { transform: scale(1.04) translate(0, -10px); }
    100% { transform: scale(1.13) translate(8px, 10px); }
}
@keyframes droneFlight4 {
    0% { transform: scale(1.08) translate(12px, -5px); }
    100% { transform: scale(1.18) translate(-12px, 5px); }
}
@keyframes droneFlight5 {
    0% { transform: scale(1.15) translate(0, 0); }
    100% { transform: scale(1.04) translate(-15px, -8px); }
}
@keyframes droneFlight6 {
    0% { transform: scale(1.05) translate(-5px, -5px); }
    100% { transform: scale(1.16) translate(10px, 10px); }
}
@keyframes droneFlight7 {
    0% { transform: scale(1.16) translate(10px, -5px); }
    100% { transform: scale(1.05) translate(-5px, 5px); }
}

.banner-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(8, 12, 28, 0.65) 0%, rgba(4, 6, 12, 0.3) 100%);
    z-index: 2;
}

.banner-content {
    position: relative;
    z-index: 3;
    max-width: 800px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    text-align: right;
}

.banner-badge {
    background: var(--primary-glow);
    border: 1px solid var(--primary);
    color: #93c5fd;
    padding: 6px 14px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 700;
    width: fit-content;
}

.banner-title {
    font-family: var(--font-heading);
    font-size: 2.1rem;
    font-weight: 900;
    color: white;
    text-shadow: 0 2px 10px rgba(0,0,0,0.5);
    line-height: 1.3;
}

.banner-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 650px;
}

/* كرت ترحيب الطالب محمد */
.student-welcome-box {
    margin-top: 15px;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 12px 18px;
    border-radius: 18px;
    width: fit-content;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.student-welcome-box h2 {
    font-size: 0.98rem;
    font-weight: 700;
    color: white;
}

.student-welcome-box p {
    font-size: 0.78rem;
    color: #60a5fa;
}

/* شبكة كروت الخدمات */
.portal-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.portal-card {
    background: rgba(15, 23, 42, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 35px 24px 28px 24px;
    border-radius: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    text-align: center;
    cursor: pointer;
    box-shadow: var(--card-shadow);
    transition: var(--transition-smooth);
    min-height: 330px;
    gap: 16px;
}

.portal-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-hover);
    box-shadow: 0 15px 35px var(--primary-glow);
    background: rgba(30, 41, 59, 0.4);
}

.p-card-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    margin-bottom: 4px;
}

.portal-card:hover .p-card-icon {
    transform: scale(1.15);
}

.p-card-info {
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-grow: 1;
    justify-content: center;
}

.p-card-info h3 {
    font-size: 1.25rem;
    font-weight: 800;
    margin: 0;
    color: var(--text-primary);
}

.p-card-info p {
    font-size: 0.88rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

.portal-card-link {
    font-size: 0.95rem;
    font-weight: 700;
    color: #3b82f6;
    margin-top: 8px;
    transition: var(--transition-smooth);
}

.portal-card:hover .portal-card-link {
    color: #60a5fa;
}

/* ==========================================================================
   2. شاشة الكليات والمكتبة (Library Styles)
   ========================================================================== */
.library-view {
    display: flex;
    flex-direction: column;
    gap: 24px;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.library-header-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.btn-back-main {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--primary);
    padding: 10px 22px;
    border-radius: 30px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
    width: fit-content;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-back-main:hover {
    border-color: var(--primary);
    background: var(--primary-glow);
    transform: translateX(5px);
}

.library-title-main {
    font-family: var(--font-heading);
    font-size: 2.2rem;
    font-weight: 900;
    margin: 0;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.library-subtitle-main {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* عنوان القسم وتحته الخط المنحني المضيء */
.section-subtitle-header {
    margin-bottom: 20px;
    position: relative;
}

.section-subtitle-header h3 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
}

.subtitle-indicator {
    width: 80px;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), transparent);
    border-radius: 20px;
    margin-top: 6px;
}

/* شبكة كروت الكليات والمساقات */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

/* كروت الكليات المستوحاة من الصورة 2 */
.college-card {
    background: var(--bg-panel);
    backdrop-filter: blur(var(--blur-intensity));
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 24px;
    box-shadow: var(--card-shadow);
    transition: var(--transition-smooth);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    height: 200px;
    text-align: center;
}

.college-card:hover {
    transform: translateY(-6px);
    border-color: var(--border-hover);
    box-shadow: 0 15px 35px var(--primary-glow);
    background: rgba(30, 41, 59, 0.4);
}

.college-card-icon {
    font-size: 32px;
    background: rgba(255,255,255,0.03);
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    transition: var(--transition-smooth);
}

.college-card:hover .college-card-icon {
    transform: scale(1.1);
    background: var(--primary-glow);
}

.college-card-info h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* شارة عدد الملفات المتاحة تحت اسم الكلية */
.college-card-info .file-badge {
    display: inline-block;
    background: rgba(255,255,255,0.05);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 4px 12px;
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-top: 8px;
    transition: var(--transition-smooth);
}

.college-card:hover .file-badge {
    background: var(--primary-glow);
    color: #93c5fd;
    border-color: var(--primary);
}

/* تفاصيل الكلية والتخصصات والمواد */
.college-detail-view {
    display: none;
    flex-direction: column;
    gap: 24px;
}

.library-tree-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px 14px;
    border: 1px solid var(--border-color);
    border-radius: 16px;
    background: rgba(15, 23, 42, 0.45);
}

.library-tree-breadcrumb button {
    border: 0;
    background: transparent;
    color: var(--text-secondary);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    padding: 5px 8px;
    border-radius: 9px;
    transition: var(--transition-smooth);
}

.library-tree-breadcrumb button:hover,
.library-tree-breadcrumb button[aria-current="page"] {
    color: #bfdbfe;
    background: var(--primary-glow);
}

.library-tree-breadcrumb .tree-breadcrumb-separator {
    color: #475569;
    font-size: 0.75rem;
}

.tree-level-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 18px;
    padding: 4px 2px 0;
}

.tree-level-kicker {
    display: inline-flex;
    color: #60a5fa;
    font-size: 0.72rem;
    font-weight: 900;
    letter-spacing: 0.04em;
    margin-bottom: 5px;
}

.tree-level-header h3 {
    font-size: 1.35rem;
    margin: 0 0 5px;
}

.tree-level-header p {
    color: var(--text-secondary);
    font-size: 0.86rem;
    margin: 0;
}

.tree-level-count {
    flex: 0 0 auto;
    padding: 7px 12px;
    border-radius: 999px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(96, 165, 250, 0.25);
    color: #93c5fd;
    font-size: 0.76rem;
    font-weight: 800;
}

.college-detail-header {
    background: var(--bg-panel);
    backdrop-filter: blur(var(--blur-intensity));
    border: 1px solid var(--border-color);
    padding: 24px;
    border-radius: 24px;
    box-shadow: var(--card-shadow);
}

.college-detail-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.college-detail-large-icon {
    font-size: 48px;
    background: var(--primary-glow);
    width: 72px;
    height: 72px;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.college-detail-text h2 {
    font-size: 1.6rem;
    font-weight: 800;
}

.college-detail-text p {
    color: var(--text-secondary);
    font-size: 0.88rem;
}

/* كروت المواد الفردية */
.course-card {
    background: var(--bg-panel);
    backdrop-filter: blur(var(--blur-intensity));
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 20px 24px;
    box-shadow: var(--card-shadow);
    transition: var(--transition-smooth);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.course-card::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: var(--primary);
}

.course-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    box-shadow: 0 8px 22px var(--primary-glow);
}

.course-card:focus-visible,
.college-card.tree-college-card:focus-visible {
    outline: 3px solid rgba(96, 165, 250, 0.55);
    outline-offset: 3px;
}

.course-card-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.course-card-title {
    font-size: 1.05rem;
    font-weight: 700;
}

.course-card-meta {
    font-size: 0.76rem;
    color: var(--text-secondary);
}

.course-card-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.college-card.tree-college-card {
    min-height: 220px;
    height: auto;
    align-items: stretch;
    text-align: right;
    justify-content: space-between;
    background:
        radial-gradient(circle at 15% 10%, rgba(59, 130, 246, 0.16), transparent 42%),
        var(--bg-panel);
}

.tree-college-card .college-card-top {
    display: flex;
    align-items: center;
    gap: 14px;
}

.tree-college-card .college-card-info {
    min-width: 0;
}

.tree-college-card .college-card-info h3 {
    margin: 0;
}

.tree-college-card .college-card-description {
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.65;
    min-height: 42px;
    margin: 4px 0 0;
}

.tree-college-stats {
    display: none !important;
}

.tree-major-card,
.tree-group-card,
.tree-course-card {
    min-height: 132px;
}

.tree-major-card {
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.11), transparent 55%),
        var(--bg-panel);
}

.tree-group-card {
    min-height: 180px;
    align-items: stretch;
    flex-direction: column;
    gap: 16px;
    background:
        linear-gradient(145deg, color-mix(in srgb, var(--tree-color) 14%, transparent), transparent 62%),
        var(--bg-panel);
}

.tree-group-card::before {
    width: 5px;
    background: var(--tree-color);
}

.tree-course-card::before {
    background: var(--tree-color);
}

.tree-group-card .tree-group-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.tree-card-icon {
    width: 48px;
    height: 48px;
    flex: 0 0 48px;
    display: grid;
    place-items: center;
    border-radius: 15px;
    background: color-mix(in srgb, var(--tree-color) 15%, transparent);
    border: 1px solid color-mix(in srgb, var(--tree-color) 35%, transparent);
    font-size: 1.45rem;
}

.tree-group-card .tree-group-description {
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1.6;
    margin-top: 7px;
}

.tree-group-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: auto;
    color: color-mix(in srgb, var(--tree-color) 78%, white);
    font-size: 0.76rem;
    font-weight: 800;
}

.tree-course-code {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 3px 8px;
    border-radius: 8px;
    color: #93c5fd;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(96, 165, 250, 0.18);
    font-size: 0.68rem;
    font-weight: 800;
    margin-bottom: 4px;
}

@media (max-width: 640px) {
    .tree-level-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .tree-college-stats {
        grid-template-columns: 1fr;
    }

    .tree-college-stat {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding-inline: 12px;
    }

    .tree-group-footer {
        align-items: flex-start;
        flex-direction: column;
    }
}

/* ==========================================================================
   2026 Premium Unified Visual System
   هوية موحّدة للبوابة والبطاقات والنماذج والنوافذ التفاعلية
   ========================================================================== */
:root {
    --ui-surface: rgba(13, 20, 38, 0.82);
    --ui-surface-strong: rgba(17, 27, 50, 0.96);
    --ui-surface-soft: rgba(30, 41, 59, 0.52);
    --ui-border: rgba(148, 163, 184, 0.16);
    --ui-border-strong: rgba(96, 165, 250, 0.38);
    --ui-accent: #4f7cff;
    --ui-accent-2: #8b5cf6;
    --ui-cyan: #22d3ee;
    --ui-radius-sm: 12px;
    --ui-radius-md: 18px;
    --ui-radius-lg: 26px;
    --ui-radius-xl: 32px;
    --ui-shadow: 0 24px 70px rgba(2, 6, 23, 0.42);
    --ui-shadow-soft: 0 14px 38px rgba(2, 6, 23, 0.24);
    --ui-ring: 0 0 0 4px rgba(79, 124, 255, 0.16);
    --ui-ease: 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

[data-theme="light"] {
    --ui-surface: rgba(255, 255, 255, 0.84);
    --ui-surface-strong: rgba(255, 255, 255, 0.97);
    --ui-surface-soft: rgba(241, 245, 249, 0.82);
    --ui-border: rgba(15, 23, 42, 0.1);
    --ui-border-strong: rgba(37, 99, 235, 0.28);
    --ui-shadow: 0 24px 70px rgba(15, 23, 42, 0.12);
    --ui-shadow-soft: 0 14px 36px rgba(15, 23, 42, 0.08);
}

html {
    color-scheme: dark;
    scroll-behavior: smooth;
}

[data-theme="light"] {
    color-scheme: light;
}

body {
    position: relative;
    background:
        radial-gradient(circle at 88% -8%, rgba(79, 124, 255, 0.2), transparent 33%),
        radial-gradient(circle at 5% 42%, rgba(139, 92, 246, 0.14), transparent 34%),
        var(--bg-main);
    background-attachment: fixed;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    opacity: 0.52;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.025) 1px, transparent 1px);
    background-size: 44px 44px;
    mask-image: linear-gradient(to bottom, black, transparent 78%);
}

button,
a,
input,
select,
textarea {
    transition:
        color var(--ui-ease),
        background-color var(--ui-ease),
        border-color var(--ui-ease),
        box-shadow var(--ui-ease),
        transform var(--ui-ease);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #60a5fa;
    outline-offset: 3px;
}

.app-container {
    width: min(100%, 1480px);
    margin-inline: auto;
    padding: 18px clamp(16px, 2.5vw, 38px) 46px;
}

.site-topbar {
    top: 12px;
    margin-bottom: 10px;
    padding: 11px 14px;
    border: 1px solid var(--ui-border);
    border-radius: 24px;
    background:
        linear-gradient(135deg, rgba(79, 124, 255, 0.08), transparent 45%),
        var(--ui-surface);
    backdrop-filter: blur(24px) saturate(145%);
    box-shadow: 0 18px 50px rgba(2, 6, 23, 0.3);
}

[data-theme="light"] .site-topbar {
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.07), transparent 48%),
        var(--ui-surface);
}

.site-topbar .brand {
    border-radius: 17px;
    padding: 5px 7px;
}

.site-topbar .brand:hover {
    background: rgba(79, 124, 255, 0.08);
}

.site-topbar .brand-icon {
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: linear-gradient(145deg, #5b8cff, #6d4ce8);
    box-shadow: 0 10px 26px rgba(79, 70, 229, 0.38);
}

.site-nav {
    border: 1px solid var(--ui-border);
    background: rgba(2, 6, 23, 0.28);
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.035);
}

[data-theme="light"] .site-nav {
    background: rgba(241, 245, 249, 0.82);
}

.site-nav-link {
    position: relative;
    isolation: isolate;
}

.site-nav-link::after {
    content: "";
    position: absolute;
    right: 24%;
    bottom: 4px;
    left: 24%;
    height: 2px;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--ui-cyan), #818cf8);
    opacity: 0;
    transform: scaleX(0.4);
    transition: var(--ui-ease);
}

.site-nav-link.active {
    background: linear-gradient(135deg, #4f7cff, #6d4ce8);
    box-shadow: 0 9px 24px rgba(79, 124, 255, 0.34);
}

.site-nav-link.active::after {
    opacity: 1;
    transform: scaleX(1);
}

.theme-toggle {
    border-color: var(--ui-border);
    background: var(--ui-surface-soft);
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.05);
}

.theme-toggle:hover {
    transform: translateY(-2px);
    border-color: var(--ui-border-strong);
    box-shadow: var(--ui-ring);
}

.portal-view,
.library-view {
    gap: 28px;
}

.portal-banner {
    min-height: clamp(380px, 43vw, 520px);
    padding: clamp(28px, 5vw, 64px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--ui-radius-xl);
    box-shadow: var(--ui-shadow);
}

.banner-overlay {
    background:
        linear-gradient(90deg, rgba(3, 7, 18, 0.15), rgba(3, 7, 18, 0.72)),
        linear-gradient(0deg, rgba(3, 7, 18, 0.45), transparent 58%);
}

.banner-content {
    max-width: 760px;
    gap: 18px;
}

.banner-badge {
    padding: 7px 15px;
    color: #dbeafe;
    border-color: rgba(147, 197, 253, 0.44);
    background: rgba(30, 64, 175, 0.24);
    backdrop-filter: blur(12px);
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.08);
}

.banner-title {
    max-width: 680px;
    font-size: clamp(2rem, 4vw, 3.4rem);
    letter-spacing: -0.035em;
    line-height: 1.18;
    text-wrap: balance;
}

.banner-desc {
    max-width: 670px;
    color: rgba(226, 232, 240, 0.9);
    font-size: clamp(0.9rem, 1.4vw, 1.05rem);
}

.student-welcome-box {
    padding: 15px 18px;
    border-color: rgba(255, 255, 255, 0.14);
    border-radius: 18px;
    background: rgba(8, 15, 31, 0.48);
    backdrop-filter: blur(18px) saturate(130%);
    box-shadow: 0 12px 35px rgba(2, 6, 23, 0.24);
}

.portal-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.portal-card {
    min-height: 390px;
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-lg);
    background: var(--ui-surface);
    box-shadow: var(--ui-shadow-soft);
}

.portal-card::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.075), transparent 32%);
}

.portal-card:hover {
    transform: translateY(-7px);
    border-color: var(--ui-border-strong);
    box-shadow: 0 24px 55px rgba(37, 99, 235, 0.2);
}

.portal-card-media {
    min-height: 245px;
}

.portal-card-media-shade {
    background:
        linear-gradient(to top, rgba(5, 10, 23, 0.98), rgba(5, 10, 23, 0.08) 68%),
        linear-gradient(140deg, rgba(79, 124, 255, 0.12), transparent 50%);
}

.portal-card-kicker {
    border-color: rgba(255, 255, 255, 0.17);
    background: rgba(3, 7, 18, 0.58);
    backdrop-filter: blur(12px);
}

.portal-card .p-card-icon {
    border-color: color-mix(in srgb, var(--service-color) 55%, transparent);
    background: color-mix(in srgb, var(--service-color) 19%, rgba(3, 7, 18, 0.62));
    box-shadow: 0 12px 30px color-mix(in srgb, var(--service-color) 28%, transparent);
}

.portal-card-title-wrap h3 {
    letter-spacing: -0.015em;
    text-shadow: 0 3px 18px rgba(0, 0, 0, 0.55);
}

.portal-card-body {
    border-top: 1px solid rgba(148, 163, 184, 0.09);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent);
}

.portal-card-link {
    color: #8db4ff;
}

.library-header-section {
    position: relative;
    overflow: hidden;
    padding: clamp(22px, 3vw, 32px);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-lg);
    background:
        radial-gradient(circle at 8% 0%, rgba(79, 124, 255, 0.18), transparent 38%),
        var(--ui-surface);
    box-shadow: var(--ui-shadow-soft);
}

.library-header-section::after {
    content: "";
    position: absolute;
    inset: auto -70px -90px auto;
    width: 210px;
    height: 210px;
    border-radius: 50%;
    border: 36px solid rgba(139, 92, 246, 0.055);
    pointer-events: none;
}

.library-title-main {
    font-size: clamp(1.75rem, 3.1vw, 2.6rem);
    letter-spacing: -0.035em;
}

.btn-back-main,
.btn-back {
    border-color: var(--ui-border);
    background: var(--ui-surface-soft);
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.04);
}

.btn-back-main:hover,
.btn-back:hover {
    border-color: var(--ui-border-strong);
    background: rgba(79, 124, 255, 0.12);
    box-shadow: var(--ui-ring);
}

.search-input,
.form-control,
.gpa-field input,
.gpa-clean-row input {
    min-height: 48px;
    border: 1px solid var(--ui-border);
    border-radius: 14px;
    background: rgba(4, 10, 24, 0.46);
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
}

[data-theme="light"] .search-input,
[data-theme="light"] .form-control,
[data-theme="light"] .gpa-field input,
[data-theme="light"] .gpa-clean-row input {
    background: rgba(248, 250, 252, 0.92);
}

.search-input:focus,
.form-control:focus,
.gpa-field input:focus,
.gpa-clean-row input:focus {
    border-color: #6694ff;
    background: color-mix(in srgb, var(--ui-surface-strong) 86%, transparent);
    box-shadow: var(--ui-ring);
}

.search-input::placeholder,
.form-control::placeholder {
    color: color-mix(in srgb, var(--text-secondary) 74%, transparent);
}

.filter-tabs {
    padding: 7px;
    border-color: var(--ui-border);
    border-radius: 17px;
    background: var(--ui-surface);
    box-shadow: var(--ui-shadow-soft);
}

.filter-tab {
    border-radius: 12px;
}

.filter-tab.active,
.filter-tab:hover {
    background: linear-gradient(135deg, #4f7cff, #6d4ce8);
    box-shadow: 0 8px 22px rgba(79, 124, 255, 0.3);
}

.college-card,
.course-card,
.book-card,
.prof-card,
.college-detail-header,
.tree-level-header,
.gpa-step-card,
.gpa-res-card,
.admin-card {
    border-color: var(--ui-border);
    background-color: var(--ui-surface);
    box-shadow: var(--ui-shadow-soft);
}

.college-card,
.course-card,
.book-card,
.prof-card,
.gpa-step-card,
.gpa-res-card {
    border-radius: var(--ui-radius-md);
}

.college-card:hover,
.course-card:hover,
.book-card:hover,
.prof-card:hover {
    border-color: var(--ui-border-strong);
    box-shadow: 0 22px 48px rgba(37, 99, 235, 0.16);
}

.college-card.tree-college-card,
.tree-major-card,
.tree-group-card {
    background-color: var(--ui-surface);
}

.tree-college-stat,
.library-tree-breadcrumb,
.tree-level-count {
    border-color: var(--ui-border);
    background-color: rgba(5, 12, 28, 0.38);
}

[data-theme="light"] .tree-college-stat,
[data-theme="light"] .library-tree-breadcrumb,
[data-theme="light"] .tree-level-count {
    background-color: rgba(241, 245, 249, 0.78);
}

.book-actions button,
.btn-contribute,
.btn-submit,
.gpa-calc-btn {
    min-height: 44px;
    border-radius: 13px;
}

.btn-read,
.btn-submit,
.gpa-calc-btn {
    background: linear-gradient(135deg, #4f7cff, #6d4ce8);
    box-shadow: 0 10px 24px rgba(79, 124, 255, 0.24);
}

.btn-read:hover,
.btn-submit:hover,
.gpa-calc-btn:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #6795ff, #7c5cef);
    box-shadow: 0 14px 30px rgba(79, 124, 255, 0.34);
}

.admin-table {
    border-collapse: separate !important;
    border-spacing: 0;
    overflow: hidden;
}

.admin-table thead {
    background: rgba(79, 124, 255, 0.075);
}

.admin-table th {
    color: #a9c3ff;
    font-weight: 800;
}

.admin-table tbody tr {
    transition: background-color var(--ui-ease);
}

.admin-table tbody tr:hover {
    background: rgba(79, 124, 255, 0.055);
}

/* النوافذ المنبثقة العامة */
.upload-modal,
.app-dialog-overlay {
    inset: 0;
    width: 100%;
    height: 100%;
    padding: clamp(12px, 3vw, 28px);
    background:
        radial-gradient(circle at 50% 18%, rgba(79, 124, 255, 0.15), transparent 32%),
        rgba(2, 6, 18, 0.82);
    backdrop-filter: blur(18px) saturate(120%);
}

.upload-content,
.app-dialog-card {
    position: relative;
    overflow: auto;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 28px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.045), transparent 30%),
        var(--ui-surface-strong);
    box-shadow:
        0 40px 100px rgba(2, 6, 23, 0.64),
        inset 0 1px rgba(255, 255, 255, 0.06);
    animation: premiumModalIn 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.upload-content {
    width: min(100%, 620px);
    max-width: 620px;
    max-height: min(88vh, 820px);
    padding: 0;
    gap: 0;
}

#add-professor-modal .upload-content,
#upload-modal .upload-content,
#add-admin-file-modal .upload-content {
    max-width: 760px !important;
}

#add-exam-modal .upload-content,
#add-service-modal .upload-content {
    max-width: 660px !important;
}

.upload-header,
.reader-header {
    position: sticky;
    top: 0;
    z-index: 2;
    min-height: 76px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--ui-border);
    background:
        linear-gradient(90deg, rgba(79, 124, 255, 0.1), transparent 55%),
        color-mix(in srgb, var(--ui-surface-strong) 94%, transparent);
    backdrop-filter: blur(20px);
}

.upload-header::before,
.reader-header::before {
    content: "";
    position: absolute;
    right: 24px;
    bottom: -1px;
    width: 68px;
    height: 2px;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--ui-cyan), var(--ui-accent-2));
}

.upload-header h3,
.reader-title-info h3 {
    font-size: 1.15rem;
    letter-spacing: -0.015em;
}

.upload-form {
    gap: 17px;
    padding: 22px 24px 26px;
}

.form-group {
    gap: 8px;
}

.form-group label {
    color: color-mix(in srgb, var(--text-primary) 78%, var(--text-secondary));
    font-size: 0.79rem;
    letter-spacing: 0.005em;
}

textarea.form-control {
    min-height: 96px;
    resize: vertical;
}

input[type="file"].form-control {
    padding: 10px;
    color: var(--text-secondary);
}

input[type="file"].form-control::file-selector-button {
    margin-inline-end: 12px;
    padding: 8px 13px;
    border: 0;
    border-radius: 10px;
    color: #eff6ff;
    background: rgba(79, 124, 255, 0.2);
    font-family: inherit;
    font-weight: 800;
    cursor: pointer;
}

.upload-form .btn-submit,
.modal-form .btn-submit {
    width: 100%;
    min-height: 50px;
    margin-top: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    background: linear-gradient(135deg, #4f7cff, #6d4ce8) !important;
    box-shadow: 0 12px 28px rgba(79, 124, 255, 0.27);
}

.btn-close-modal,
#btn-close-chatbot {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    display: grid !important;
    place-items: center;
    padding: 0 !important;
    border: 1px solid var(--ui-border) !important;
    border-radius: 12px !important;
    color: transparent !important;
    background: rgba(148, 163, 184, 0.08) !important;
    font-size: 0 !important;
}

.btn-close-modal::before,
#btn-close-chatbot::before {
    content: "×";
    color: var(--text-secondary);
    font: 400 1.6rem/1 system-ui, sans-serif;
}

.btn-close-modal:hover,
#btn-close-chatbot:hover {
    transform: rotate(5deg) scale(1.04);
    border-color: rgba(248, 113, 113, 0.4) !important;
    background: rgba(239, 68, 68, 0.12) !important;
}

.btn-close-modal:hover::before,
#btn-close-chatbot:hover::before {
    color: #fca5a5;
}

@keyframes premiumModalIn {
    from { opacity: 0; transform: translateY(18px) scale(0.975); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* حوار الرسائل والتأكيد الموحّد */
.app-dialog-overlay {
    position: fixed;
    z-index: 12000;
    display: none;
    align-items: center;
    justify-content: center;
}

.app-dialog-overlay.is-open {
    display: flex;
}

body.app-dialog-open {
    overflow: hidden;
}

.app-dialog-card {
    width: min(100%, 470px);
    padding: 30px;
    overflow: hidden;
    text-align: center;
}

.app-dialog-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 3px;
    background: linear-gradient(90deg, #22d3ee, #4f7cff, #8b5cf6);
}

.app-dialog-close {
    position: absolute;
    top: 16px;
    left: 16px;
}

.app-dialog-icon {
    width: 68px;
    height: 68px;
    display: grid;
    place-items: center;
    margin: 2px auto 18px;
    border: 1px solid rgba(52, 211, 153, 0.35);
    border-radius: 22px;
    color: #6ee7b7;
    background: rgba(16, 185, 129, 0.12);
    box-shadow: 0 14px 34px rgba(16, 185, 129, 0.16);
    font-size: 1.9rem;
    font-weight: 900;
}

.app-dialog-overlay[data-tone="warning"] .app-dialog-icon {
    color: #fcd34d;
    border-color: rgba(245, 158, 11, 0.36);
    background: rgba(245, 158, 11, 0.12);
    box-shadow: 0 14px 34px rgba(245, 158, 11, 0.15);
}

.app-dialog-overlay[data-tone="danger"] .app-dialog-icon {
    color: #fca5a5;
    border-color: rgba(239, 68, 68, 0.38);
    background: rgba(239, 68, 68, 0.12);
    box-shadow: 0 14px 34px rgba(239, 68, 68, 0.16);
}

.app-dialog-kicker {
    display: block;
    margin-bottom: 7px;
    color: #7fa6ff;
    font-size: 0.7rem;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.app-dialog-copy h3 {
    margin: 0 0 10px;
    font-size: 1.3rem;
}

.app-dialog-copy p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.85;
    white-space: pre-line;
}

.app-dialog-actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
}

.app-dialog-btn {
    flex: 1;
    min-height: 46px;
    border: 1px solid var(--ui-border);
    border-radius: 13px;
    color: var(--text-primary);
    font-family: inherit;
    font-weight: 800;
    cursor: pointer;
}

.app-dialog-btn.primary {
    border-color: transparent;
    color: #fff;
    background: linear-gradient(135deg, #4f7cff, #6d4ce8);
    box-shadow: 0 10px 24px rgba(79, 124, 255, 0.26);
}

.app-dialog-overlay[data-tone="danger"] .app-dialog-btn.primary {
    background: linear-gradient(135deg, #ef4444, #dc2626);
    box-shadow: 0 10px 24px rgba(239, 68, 68, 0.24);
}

.app-dialog-btn.secondary {
    background: rgba(148, 163, 184, 0.08);
}

.app-dialog-btn:hover {
    transform: translateY(-2px);
}

/* الإشعارات الموحدة */
#app-notifications-container {
    position: fixed;
    top: 22px;
    left: 22px;
    z-index: 11500;
    width: min(390px, calc(100vw - 32px));
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.app-notification-toast {
    position: relative;
    overflow: hidden;
    padding: 15px 16px;
    border: 1px solid var(--ui-border-strong);
    border-radius: 17px;
    color: var(--text-primary);
    background:
        linear-gradient(120deg, rgba(79, 124, 255, 0.11), transparent 52%),
        var(--ui-surface-strong);
    box-shadow: var(--ui-shadow);
    backdrop-filter: blur(18px);
    pointer-events: auto;
    animation: premiumToastIn 260ms ease both;
}

.app-notification-toast::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 2px;
    background: linear-gradient(90deg, #22d3ee, #4f7cff, #8b5cf6);
}

.app-notification-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.app-notification-header strong {
    color: #9dbaff;
    font-size: 0.9rem;
}

.app-notification-toast p {
    margin: 5px 0 0;
    color: var(--text-secondary);
    font-size: 0.82rem;
    line-height: 1.65;
}

.app-notification-close {
    width: 29px;
    height: 29px;
    display: grid;
    place-items: center;
    border: 0;
    border-radius: 9px;
    color: var(--text-secondary);
    background: rgba(148, 163, 184, 0.08);
    cursor: pointer;
    font-size: 1.2rem;
}

.app-notification-toast.is-leaving {
    animation: premiumToastOut 260ms ease both;
}

@keyframes premiumToastIn {
    from { opacity: 0; transform: translateX(-22px) scale(0.98); }
    to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes premiumToastOut {
    to { opacity: 0; transform: translateX(-20px) scale(0.98); }
}

.download-toast {
    border-color: var(--ui-border-strong);
    border-radius: 18px;
    background: var(--ui-surface-strong);
    box-shadow: var(--ui-shadow);
}

.download-progress-bar {
    background: linear-gradient(90deg, #22d3ee, #4f7cff, #8b5cf6);
}

/* مساعد البوابة والأزرار العائمة */
#floating-actions-container button {
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    box-shadow: 0 16px 34px rgba(2, 6, 23, 0.35) !important;
    backdrop-filter: blur(14px);
}

#floating-actions-container button:hover {
    transform: translateY(-4px) scale(1.04);
}

#chatbot-panel {
    border-color: var(--ui-border-strong) !important;
    border-radius: 26px !important;
    background: var(--ui-surface-strong) !important;
    box-shadow: var(--ui-shadow) !important;
}

#chatbot-panel > div:first-child {
    background: linear-gradient(135deg, #4f7cff, #6d4ce8) !important;
}

#chatbot-messages {
    background:
        radial-gradient(circle at 100% 0%, rgba(79, 124, 255, 0.11), transparent 34%),
        rgba(4, 10, 24, 0.54) !important;
}

#chatbot-form {
    border-color: var(--ui-border) !important;
    background: var(--ui-surface-strong) !important;
}

#chatbot-form button[type="submit"] {
    min-width: 72px;
    border-radius: 12px !important;
    background: linear-gradient(135deg, #4f7cff, #6d4ce8) !important;
}

@media (max-width: 1080px) {
    .portal-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    .app-container {
        padding: 10px 12px 34px;
    }

    .site-topbar {
        border-radius: 20px;
    }

    .portal-banner {
        min-height: 430px;
        border-radius: 25px;
        padding: 26px 22px;
    }

    .portal-grid {
        grid-template-columns: 1fr;
    }

    .portal-card {
        min-height: 350px;
    }

    .library-header-section {
        padding: 20px;
        border-radius: 22px;
    }

    .filter-tabs {
        width: 100%;
        overflow-x: auto;
    }

    .filter-tab {
        flex: 0 0 auto;
    }

    .upload-modal,
    .reader-modal,
    .app-dialog-overlay {
        align-items: flex-end;
        padding: 8px;
    }

    .upload-content,
    .app-dialog-card {
        width: 100%;
        max-height: calc(100dvh - 16px);
        border-radius: 24px;
    }

    .upload-header {
        min-height: 68px;
        padding: 17px 18px;
    }

    .upload-form {
        padding: 18px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .app-dialog-card {
        padding: 26px 20px 20px;
    }

    .app-dialog-actions {
        flex-direction: column-reverse;
    }

    #app-notifications-container {
        top: 12px;
        left: 16px;
    }

    #chatbot-panel {
        right: 10px !important;
        bottom: 78px !important;
        width: calc(100vw - 20px) !important;
        max-width: none !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* ==========================================================================
   3. حاسبة المعدل التراكمي (GPA Calculator layout)
   ========================================================================== */

/* ── الحاوية الرئيسية ── */
.gpa-main-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0;
    animation: fadeIn 0.4s ease;
    max-width: 900px;
    margin: 0 auto;
    width: 100%;
}

/* ── بطاقة كل قسم ── */
.gpa-section-card {
    background: rgba(22, 28, 50, 0.7);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 20px;
    padding: 22px 24px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

[data-theme="light"] .gpa-section-card {
    background: rgba(255, 255, 255, 0.92);
    border: 1px solid rgba(0,0,0,0.08);
}

/* ── رأس كل قسم ── */
.gpa-section-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    padding-bottom: 14px;
}

[data-theme="light"] .gpa-section-header {
    border-bottom: 1px solid rgba(0,0,0,0.06);
}

.gpa-section-icon {
    font-size: 1.3rem;
}

.gpa-section-header h2 {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text-primary);
}

/* ── سلّم التقدير المرجعي ── */
.gpa-grade-scale {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.07);
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 0.82rem;
    font-weight: 700;
}

[data-theme="light"] .gpa-grade-scale {
    background: rgba(0,0,0,0.03);
    border-color: rgba(0,0,0,0.06);
}

.gpa-scale-item {
    font-weight: 800;
}

.gpa-scale-sep {
    color: rgba(255,255,255,0.2);
    font-weight: 300;
}

[data-theme="light"] .gpa-scale-sep {
    color: rgba(0,0,0,0.15);
}


/* ── صف المعدل السابق ── */
.gpa-prev-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 600px) {
    .gpa-prev-row { grid-template-columns: 1fr; }
}

/* ── علامة الحقل الإجباري ── */
.gpa-required {
    color: #ef4444;
    font-weight: 900;
    font-size: 1rem;
    margin-right: 2px;
}

/* ── ملاحظة الفصل الأول ── */
.gpa-first-sem-note {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(167, 139, 250, 0.08);
    border: 1px solid rgba(167, 139, 250, 0.25);
    border-radius: 10px;
    padding: 10px 14px;
    font-size: 0.85rem;
    color: #c4b5fd;
    margin-bottom: 14px;
    line-height: 1.5;
}

[data-theme="light"] .gpa-first-sem-note {
    background: rgba(109, 40, 217, 0.05);
    border-color: rgba(109, 40, 217, 0.15);
    color: #7c3aed;
}



/* ── حقول الإدخال المصممة ── */
.gpa-input-styled {
    background: rgba(0,0,0,0.2) !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
    border-radius: 12px !important;
    padding: 12px 16px !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    color: var(--text-primary) !important;
    text-align: right;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.gpa-input-styled:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.15) !important;
    outline: none;
}

[data-theme="light"] .gpa-input-styled {
    background: rgba(0,0,0,0.04) !important;
    border: 1px solid rgba(0,0,0,0.12) !important;
}

/* ── زر إضافة مساق ── */
.gpa-add-btn {
    background: rgba(139, 92, 246, 0.15);
    border: 1px solid rgba(139, 92, 246, 0.35);
    color: #a78bfa;
    padding: 8px 16px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font-body);
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}

.gpa-add-btn:hover {
    background: rgba(139, 92, 246, 0.3);
    color: #c4b5fd;
}

/* ── رأس جدول المواد ── */
.gpa-table-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 44px;
    gap: 10px;
    padding: 8px 10px;
    margin-bottom: 6px;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-align: right;
    border-bottom: 1px solid rgba(255,255,255,0.05);
}

/* ── الحاوية المواد ── */
.gpa-list-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
    margin-bottom: 18px;
}

/* ── صف مادة واحدة ── */
.gpa-row-new {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 44px;
    gap: 10px;
    align-items: center;
}

.gpa-row-new .form-control {
    background: rgba(0,0,0,0.2);
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: 10px;
    padding: 10px 12px;
    font-size: 0.9rem;
    color: var(--text-primary);
    text-align: right;
    transition: border-color 0.2s;
}

.gpa-row-new .form-control:focus {
    border-color: var(--primary);
    outline: none;
}

[data-theme="light"] .gpa-row-new .form-control {
    background: rgba(0,0,0,0.04);
    border-color: rgba(0,0,0,0.1);
}

/* ── زر حذف صف ── */
.btn-remove-row-new {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.25);
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
}

.btn-remove-row-new:hover {
    background: rgba(239, 68, 68, 0.25);
    color: #fca5a5;
}

/* ── زر الحساب الكبير ── */
.gpa-calculate-btn {
    width: 100%;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    border: none;
    border-radius: 14px;
    color: white;
    padding: 16px;
    font-size: 1.05rem;
    font-weight: 800;
    font-family: var(--font-heading);
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.35);
}

.gpa-calculate-btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.gpa-calculate-btn:active {
    transform: translateY(0);
}

/* ── منطقة النتائج ── */
.gpa-results-reveal {
    margin-top: 20px;
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 0 4px 24px rgba(16, 185, 129, 0.1);
}

/* ── الصفائح البدوية (معدل فصلي + تراكمي) ── */
.gpa-results-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.gpa-result-badge {
    flex: 1;
    min-width: 180px;
    text-align: center;
    background: rgba(255,255,255,0.04);
    border-radius: 18px;
    padding: 22px 16px;
    border: 1px solid rgba(255,255,255,0.07);
}

.semester-badge {
    border-color: rgba(14, 165, 233, 0.3);
    background: rgba(14, 165, 233, 0.07);
}

.cumulative-badge {
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.07);
}

.gpa-badge-label {
    font-size: 0.82rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-weight: 600;
}

.gpa-badge-val {
    font-size: 2.6rem;
    font-weight: 900;
    font-family: var(--font-heading);
    line-height: 1;
    margin-bottom: 6px;
}

.gpa-badge-sub {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 600;
}

.gpa-result-separator {
    font-size: 2rem;
    color: var(--text-secondary);
    font-weight: 300;
}

/* ── جدول التفاصيل ── */
.gpa-breakdown-tbl {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
    margin-bottom: 18px;
    text-align: right;
}

.gpa-breakdown-tbl th {
    padding: 10px 12px;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
    border-bottom: 2px solid rgba(255,255,255,0.08);
}

.gpa-breakdown-tbl td {
    padding: 10px 12px;
    border-bottom: 1px solid rgba(255,255,255,0.04);
    color: var(--text-primary);
}

.gpa-breakdown-tbl tfoot td {
    padding: 12px 12px;
    border-top: 2px solid rgba(255,255,255,0.08);
    border-bottom: none;
}

[data-theme="light"] .gpa-breakdown-tbl th,
[data-theme="light"] .gpa-breakdown-tbl td {
    border-color: rgba(0,0,0,0.06);
}

/* ── زر إعادة الحساب ── */
.gpa-reset-btn {
    width: 100%;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 12px;
    color: var(--text-secondary);
    padding: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    font-family: var(--font-body);
    transition: background 0.2s, color 0.2s;
}

.gpa-reset-btn:hover {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
}

/* للتوافق مع الإصدارات القديمة من CSS (يُبقي على الصفوف القديمة) */
.gpa-container-layout { display: flex; flex-direction: column; gap: 20px; }
.gpa-card-input { background: var(--bg-panel); border: 1px solid var(--border-color); border-radius: 24px; padding: 24px; }
.gpa-row { display: grid; grid-template-columns: 2fr 1fr 1.2fr auto; gap: 12px; align-items: center; }
.btn-remove-row { background: rgba(239,68,68,0.1); color:#ef4444; border:1px solid rgba(239,68,68,0.25); width:38px; height:38px; border-radius:10px; cursor:pointer; }
.gpa-result-grid { display: grid; grid-template-columns: repeat(3,1fr); gap:15px; }
.gpa-result-card { background:var(--bg-card); padding:16px; border-radius:18px; text-align:center; }
.gpa-result-label { font-size:0.82rem; color:var(--text-secondary); }
.gpa-result-val { font-size:1.8rem; font-weight:800; margin-top:6px; }

/* ==========================================================================
   التصميم النظيف للحاسبة (Clean Mobile GPA)
   ========================================================================== */

/* الحاوية الرئيسية */
.gpa-clean-wrapper {
    max-width: 640px;
    margin: 0 auto;
    padding: 0 4px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* شريط سلّم التقدير */
.gpa-scale-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(255,255,255,0.06);
    border-radius: 14px;
    padding: 10px 14px;
    font-size: 0.78rem;
    font-weight: 800;
}
[data-theme="light"] .gpa-scale-bar {
    background: rgba(0,0,0,0.03);
    border-color: rgba(0,0,0,0.06);
}

/* بطاقة خطوة */
.gpa-step-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 18px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

/* عنوان الخطوة */
.gpa-step-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 1rem;
    font-weight: 800;
    color: var(--text-primary);
}

/* رقم الخطوة */
.gpa-step-num {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    font-size: 0.9rem;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* تلميح الخطوة */
.gpa-step-hint {
    font-size: 0.82rem;
    color: #a78bfa;
    background: rgba(167,139,250,0.08);
    border: 1px solid rgba(167,139,250,0.2);
    border-radius: 10px;
    padding: 8px 12px;
    margin-bottom: 14px;
    line-height: 1.5;
}
[data-theme="light"] .gpa-step-hint { color: #7c3aed; background: rgba(109,40,217,0.04); }

/* عمودان للمدخلات */
.gpa-two-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
@media (max-width: 420px) { .gpa-two-cols { grid-template-columns: 1fr; } }

/* حقل إدخال */
.gpa-field label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.gpa-field input {
    width: 100%;
    background: rgba(0,0,0,0.15);
    border: 1.5px solid rgba(255,255,255,0.09);
    border-radius: 11px;
    padding: 11px 13px;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
    font-family: var(--font-body);
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}
.gpa-field input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(14,165,233,0.15);
}
[data-theme="light"] .gpa-field input {
    background: rgba(0,0,0,0.04);
    border-color: rgba(0,0,0,0.1);
}

/* رؤوس الأعمدة */
.gpa-cols-header {
    display: grid;
    grid-template-columns: 2fr 1fr 1.2fr 36px;
    gap: 8px;
    padding: 0 4px 8px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
    text-align: right;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    margin-bottom: 8px;
}
[data-theme="light"] .gpa-cols-header { border-color: rgba(0,0,0,0.06); }

/* صف مادة */
.gpa-clean-row {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1.5fr 40px;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
}
.gpa-course-name-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.12);
    border: 1.5px solid rgba(59, 130, 246, 0.25);
    border-radius: 10px;
    padding: 10px 8px;
    font-size: 0.88rem;
    font-weight: 800;
    color: #60a5fa;
    user-select: none;
    height: 100%;
    box-sizing: border-box;
}
[data-theme="light"] .gpa-course-name-badge {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}
.gpa-clean-row input {
    width: 100%;
    background: rgba(0,0,0,0.12);
    border: 1.5px solid rgba(255,255,255,0.07);
    border-radius: 10px;
    padding: 10px 10px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: right;
    font-family: var(--font-body);
    transition: border-color 0.2s;
    box-sizing: border-box;
}
.gpa-clean-row input:focus {
    outline: none;
    border-color: var(--primary);
}
[data-theme="light"] .gpa-clean-row input {
    background: rgba(0,0,0,0.03);
    border-color: rgba(0,0,0,0.09);
}
/* زر إضافة مادة */
.gpa-add-pill {
    margin-right: auto;
    background: rgba(139,92,246,0.12);
    border: 1px solid rgba(139,92,246,0.3);
    color: #a78bfa;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font-body);
    transition: background 0.2s;
    white-space: nowrap;
}
.gpa-add-pill:hover { background: rgba(139,92,246,0.22); }

/* زر حذف صف */
.gpa-del-btn {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: rgba(239,68,68,0.09);
    border: 1px solid rgba(239,68,68,0.2);
    color: #ef4444;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}
.gpa-del-btn:hover { background: rgba(239,68,68,0.2); }

/* زر الحساب */
.gpa-calc-btn {
    width: 100%;
    margin-top: 14px;
    background: linear-gradient(135deg, #10b981, #059669);
    border: none;
    border-radius: 14px;
    color: #fff;
    padding: 15px;
    font-size: 1.05rem;
    font-weight: 800;
    font-family: var(--font-heading);
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(16,185,129,0.3);
    transition: transform 0.15s, opacity 0.15s;
    letter-spacing: 0.3px;
}
.gpa-calc-btn:hover  { opacity: 0.92; transform: translateY(-2px); }
.gpa-calc-btn:active { transform: translateY(0); }

/* ── منطقة النتائج ── */
#gpa-results-box {
    display: none;
    animation: fadeIn 0.4s ease;
}

/* بطاقتا النتيجة */
.gpa-result-cards {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 14px;
}
.gpa-res-card {
    border-radius: 16px;
    padding: 18px 14px;
    text-align: center;
    border: 1.5px solid transparent;
}
.gpa-res-sem {
    background: rgba(14,165,233,0.07);
    border-color: rgba(14,165,233,0.25);
}
.gpa-res-cum {
    background: rgba(16,185,129,0.07);
    border-color: rgba(16,185,129,0.25);
}
.gpa-res-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 6px;
}
.gpa-res-num {
    font-size: 2rem;
    font-weight: 900;
    font-family: var(--font-heading);
    line-height: 1;
    margin-bottom: 4px;
}
.gpa-res-tag {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-secondary);
}

/* جدول التفاصيل */
.gpa-details-table {
    margin-bottom: 14px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255,255,255,0.06);
}
[data-theme="light"] .gpa-details-table { border-color: rgba(0,0,0,0.06); }
.gpa-details-table table { width:100%; border-collapse:collapse; font-size:0.85rem; text-align:right; }
.gpa-details-table th {
    background: rgba(255,255,255,0.04);
    padding: 10px 12px;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-secondary);
}
.gpa-details-table td { padding: 10px 12px; border-top: 1px solid rgba(255,255,255,0.04); color: var(--text-primary); }
[data-theme="light"] .gpa-details-table th { background: rgba(0,0,0,0.03); }
[data-theme="light"] .gpa-details-table td { border-color: rgba(0,0,0,0.04); }
.gpa-details-table tfoot td { background: rgba(255,255,255,0.03); border-top: 2px solid rgba(255,255,255,0.08); font-weight: 800; }

/* زر حساب جديد */
.gpa-retry-btn {
    width: 100%;
    background: rgba(255,255,255,0.04);
    border: 1.5px solid rgba(255,255,255,0.08);
    border-radius: 12px;
    color: var(--text-secondary);
    padding: 12px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    font-family: var(--font-body);
    transition: background 0.2s, color 0.2s;
}
.gpa-retry-btn:hover { background: rgba(255,255,255,0.09); color: var(--text-primary); }


/* ==========================================================================
   4. مكاتب الدكاترة والتراسل (Professors Grid)
   ========================================================================== */
.prof-card {
    background: var(--bg-panel);
    backdrop-filter: blur(var(--blur-intensity));
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 24px;
    box-shadow: var(--card-shadow);
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.prof-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    box-shadow: 0 10px 25px var(--primary-glow);
}

.prof-header {
    display: flex;
    align-items: center;
    gap: 16px;
}

.prof-avatar {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: var(--primary-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    color: var(--primary);
}

.prof-name-title h3 {
    font-size: 1.15rem;
    font-weight: 700;
}

.prof-name-title p {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.prof-body-info {
    border-top: 1px solid var(--border-color);
    padding-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.82rem;
}

.prof-detail-item {
    display: flex;
    justify-content: space-between;
    color: var(--text-secondary);
}

.prof-detail-item span strong {
    color: var(--text-primary);
}

/* ==========================================================================
   إدارة المشرف واللوحة الخلفية (Admin Panel tables)
   ========================================================================== */
/* التقسيم الرئيسي للواجهة */
.main-layout {
    width: 100%;
    display: block;
}

/* التبويبات والمساهمة */

.btn-contribute {
    background: var(--bg-card);
    border: 1px dashed var(--primary);
    color: var(--primary);
    padding: 12px;
    border-radius: 14px;
    cursor: pointer;
    font-weight: 700;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-contribute:hover {
    background: var(--primary);
    color: white;
    transform: scale(1.02);
}

.content-area {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* شريط البحث العائم */
.search-container {
    position: relative;
    width: 100%;
}

.search-input {
    width: 100%;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 16px 52px 16px 20px;
    font-size: 0.95rem;
    color: var(--text-primary);
    outline: none;
    transition: var(--transition-smooth);
    box-shadow: var(--card-shadow);
    min-height: 48px;
}

.library-search-help {
    margin: -10px 4px 0;
    color: var(--text-secondary);
    font-size: 0.82rem;
}

.library-global-search-results[hidden] {
    display: none !important;
}

.library-global-search-results {
    border: 1px solid var(--border-color);
    border-radius: 20px;
    background: var(--bg-panel);
    box-shadow: var(--card-shadow);
    overflow: hidden;
}

.library-search-results-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-color);
}

.library-search-results-heading h2 {
    margin: 0;
    font-size: 1.05rem;
}

.library-search-results-count,
.library-search-result-files {
    flex: 0 0 auto;
    padding: 6px 10px;
    border-radius: 999px;
    color: #bfdbfe;
    background: rgba(59, 130, 246, 0.14);
    font-size: 0.78rem;
    font-weight: 800;
}

.library-search-results-list {
    display: grid;
    max-height: min(58vh, 560px);
    overflow-y: auto;
}

.library-search-result {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    min-height: 64px;
    padding: 12px 18px;
    border: 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
    background: transparent;
    text-align: start;
    font: inherit;
    cursor: pointer;
}

.library-search-result:hover,
.library-search-result:focus-visible {
    background: var(--primary-glow);
}

.library-search-result:focus-visible {
    outline: 3px solid #60a5fa;
    outline-offset: -3px;
}

.library-search-result-main {
    display: grid;
    gap: 5px;
    min-width: 0;
}

.library-search-result-main span {
    color: var(--text-secondary);
    font-size: 0.8rem;
    line-height: 1.6;
}

.library-search-empty {
    padding: 28px 18px;
    text-align: center;
}

.library-search-empty p {
    margin: 8px 0 0;
    color: var(--text-secondary);
}

.search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 20px var(--primary-glow);
    background: var(--bg-input);
}

.search-icon {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    font-size: 1.15rem;
    color: var(--text-muted);
}

#prof-search-input {
    min-width: min(440px, 100%);
}

@media (max-width: 480px) {
    .search-input {
        min-height: 52px;
        padding-inline: 48px 14px;
        font-size: 1rem;
    }

    .library-search-result {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
        min-height: 72px;
    }

    .library-search-result-files {
        align-self: flex-start;
    }
}

/* التصفية بفئات الكتب */
.filter-tabs {
    display: flex;
    gap: 8px;
    background: var(--bg-panel);
    padding: 6px;
    border-radius: 16px;
    border: 1px solid var(--border-color);
    width: fit-content;
}

.filter-tab {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    padding: 8px 18px;
    font-weight: 600;
    font-size: 0.85rem;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition-smooth);
}

.filter-tab.active, .filter-tab:hover {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
    gap: 20px;
}

/* بطاقات الكتب */
.book-card {
    background: var(--bg-panel);
    backdrop-filter: blur(var(--blur-intensity));
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 22px;
    box-shadow: var(--card-shadow);
    transition: var(--transition-smooth);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 15px;
    position: relative;
    min-height: 240px;
}

.book-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
    box-shadow: 0 12px 30px var(--primary-glow);
}

.book-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.book-type-badge {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
}

.file-format-badge {
    font-size: 0.72rem;
    font-weight: 800;
    padding: 4px 9px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    letter-spacing: 0.2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    transition: all 0.2s ease;
}

.fmt-pdf {
    background: rgba(239, 68, 68, 0.16);
    color: #f87171;
    border: 1px solid rgba(239, 68, 68, 0.35);
}

.fmt-pptx {
    background: rgba(249, 115, 22, 0.16);
    color: #fb923c;
    border: 1px solid rgba(249, 115, 22, 0.35);
}

.fmt-docx {
    background: rgba(59, 130, 246, 0.16);
    color: #60a5fa;
    border: 1px solid rgba(59, 130, 246, 0.35);
}

.fmt-zip {
    background: rgba(168, 85, 247, 0.16);
    color: #c084fc;
    border: 1px solid rgba(168, 85, 247, 0.35);
}

.fmt-video {
    background: rgba(236, 72, 153, 0.16);
    color: #f472b6;
    border: 1px solid rgba(236, 72, 153, 0.35);
}

.fmt-file {
    background: rgba(148, 163, 184, 0.16);
    color: #cbd5e1;
    border: 1px solid rgba(148, 163, 184, 0.35);
}

.type-book {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.25);
}
.type-summary {
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
    border: 1px solid rgba(59, 130, 246, 0.25);
}
.type-exam {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent);
    border: 1px solid rgba(245, 158, 11, 0.25);
}

.btn-bookmark {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.25rem;
    transition: var(--transition-smooth);
}

.btn-bookmark.active {
    color: #ef4444;
    filter: drop-shadow(0 0 3px rgba(239, 68, 68, 0.4));
}

.btn-bookmark:hover {
    transform: scale(1.15);
}

.book-body h4 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 4px;
    line-height: 1.45;
}

.book-author {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.book-desc {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.55;
}

.book-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid var(--border-color);
    padding-top: 10px;
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.book-rating {
    color: var(--accent);
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 3px;
}

.book-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.book-link-unavailable {
    margin: 8px 0 0;
    padding: 8px 10px;
    border: 1px solid rgba(239, 68, 68, 0.35);
    border-radius: 10px;
    color: #fecaca;
    background: rgba(127, 29, 29, 0.24);
    font-size: 0.78rem;
    font-weight: 800;
}

.book-actions button:disabled {
    opacity: 0.52;
    cursor: not-allowed;
    filter: grayscale(0.7);
}

.chatbot-result-link {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    margin-top: 8px;
    padding: 8px 12px;
    border: 1px solid rgba(191, 219, 254, 0.65);
    border-radius: 10px;
    color: #eff6ff;
    text-decoration: underline;
}

.portal-connection-status {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 5px 10px;
    border: 1px solid rgba(34, 197, 94, 0.32);
    border-radius: 999px;
    color: #bbf7d0;
    background: rgba(22, 101, 52, 0.18);
    font-size: 0.72rem;
    font-weight: 800;
    white-space: nowrap;
}

.portal-connection-status.is-offline {
    border-color: rgba(245, 158, 11, 0.4);
    color: #fef3c7;
    background: rgba(120, 53, 15, 0.28);
}

.library-data-summary {
    width: fit-content;
    max-width: 100%;
    margin: 14px auto 0;
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    color: var(--text-secondary);
    background: var(--bg-card);
    font-weight: 800;
}

@media (max-width: 760px) {
    .portal-connection-status {
        max-width: 96px;
        overflow: hidden;
        text-overflow: ellipsis;
    }
}

.btn-read {
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    padding: 10px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.82rem;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-read:hover {
    background: var(--primary-glow);
    border-color: var(--primary);
}

.btn-download {
    background: var(--primary);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.82rem;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-download:hover {
    background: #1d4ed8;
    box-shadow: 0 4px 12px var(--primary-glow);
}

/* القارئ الرقمي ونوافذ النماذج */
.reader-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw !important;
    height: 100vh !important;
    background: #020617;
    backdrop-filter: blur(12px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 0 !important;
    margin: 0 !important;
}

.reader-content {
    background: #090d16;
    border: none;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100vh !important;
    max-height: 100vh !important;
    border-radius: 0 !important;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    animation: zoomIn 0.2s ease-out;
}

@keyframes zoomIn {
    from { transform: scale(0.98); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.reader-header {
    padding: 18px 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.reader-title-info h3 {
    font-size: 1.15rem;
    font-weight: 700;
}

.reader-title-info p {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

.btn-close-modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition-smooth);
}

.btn-close-modal:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
    transform: scale(1.08);
}

/* شريط أدوات القارئ */
.reader-toolbar {
    background: rgba(15, 23, 42, 0.6);
    padding: 10px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.toolbar-btn {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 6px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.82rem;
    font-weight: 600;
    transition: var(--transition-smooth);
}

.toolbar-btn:hover {
    border-color: var(--primary);
    background: var(--primary-glow);
}

.zoom-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.zoom-level {
    font-size: 0.85rem;
    font-weight: 700;
    min-width: 45px;
    text-align: center;
}

.reader-body {
    flex-grow: 1;
    overflow: auto;
    padding: 30px;
    background: #020617;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

.pdf-viewer-container {
    width: 100%;
    display: flex;
    justify-content: center;
}

.pdf-page-wrapper {
    background: white;
    color: #334155;
    width: 100%;
    max-width: 600px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border-radius: 12px;
    overflow: hidden;
    transition: transform 0.2s ease;
}

.pdf-page {
    padding: 40px;
    min-height: 700px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.pdf-header {
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 10px;
    font-size: 0.72rem;
    color: #94a3b8;
    display: flex;
    justify-content: space-between;
}

.pdf-content {
    flex-grow: 1;
    padding: 30px 0;
}

.pdf-content h2 {
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: #1e293b;
}

.pdf-content p {
    font-size: 0.85rem;
    line-height: 1.7;
    margin-bottom: 12px;
}

.pdf-footer {
    border-top: 1px solid #e2e8f0;
    padding-top: 10px;
    font-size: 0.72rem;
    color: #94a3b8;
    text-align: center;
}

/* إشعار شريط التحميل */
.download-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background: var(--bg-panel);
    backdrop-filter: blur(var(--blur-intensity));
    border: 1px solid var(--border-color);
    padding: 16px 20px;
    border-radius: 20px;
    display: none;
    align-items: center;
    gap: 16px;
    box-shadow: var(--card-shadow);
    z-index: 2500;
    width: 320px;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from { transform: translateX(110%); }
    to { transform: translateX(0); }
}

.download-icon {
    font-size: 24px;
    color: var(--primary);
    animation: bounce 1.5s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.download-info {
    flex-grow: 1;
}

.download-title {
    font-size: 0.82rem;
    font-weight: 700;
    margin-bottom: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.download-progress-bar-container {
    background: rgba(255,255,255,0.06);
    height: 6px;
    border-radius: 10px;
    overflow: hidden;
}

.download-progress-bar {
    background: var(--primary);
    width: 0%;
    height: 100%;
    border-radius: 10px;
    transition: width 0.1s ease;
}

.download-percent {
    font-size: 0.82rem;
    font-weight: 700;
}

/* نوافذ المودال والإدخال للمشرف */
.upload-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(2, 6, 23, 0.85);
    backdrop-filter: blur(12px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10050;
    padding: 20px;
    overflow-y: auto;
    box-sizing: border-box;
}

.upload-content {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 520px;
    max-height: 85vh;
    overflow-y: auto;
    border-radius: 24px;
    box-shadow: var(--card-shadow);
    padding: 26px;
    animation: zoomIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    display: flex;
    flex-direction: column;
    gap: 18px;
    box-sizing: border-box;
}

.upload-content::-webkit-scrollbar {
    width: 6px;
}

.upload-content::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 10px;
}

.upload-content::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}

.upload-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.upload-header h3 {
    font-size: 1.25rem;
    font-weight: 800;
}

.upload-form {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
}

.form-control {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 11px 14px;
    border-radius: 12px;
    color: var(--text-primary);
    font-size: 0.9rem;
    outline: none;
    transition: var(--transition-smooth);
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
    background: var(--bg-card);
}

.form-control option {
    background: #0f172a;
    color: white;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.btn-submit {
    background: var(--primary);
    color: white;
    border: none;
    padding: 13px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.95rem;
    transition: var(--transition-smooth);
    margin-top: 10px;
}

.btn-submit:hover {
    background: #1d4ed8;
    box-shadow: 0 5px 15px var(--primary-glow);
}

/* إدارة المشرف واللوحة الخلفية */
#admin-mode-toggle-btn.admin-active {
    background: #059669 !important;
    border-color: #10b981 !important;
    color: white !important;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.4);
}

.course-card {
    background: var(--bg-panel);
    backdrop-filter: blur(var(--blur-intensity));
    border: 1px solid var(--border-color);
    border-radius: 18px;
    padding: 18px 24px;
    box-shadow: var(--card-shadow);
    transition: var(--transition-smooth);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.course-card::before {
    content: '';
    position: absolute;
    right: 0;
    top: 0;
    height: 100%;
    width: 4px;
    background: var(--primary);
}

.course-card:hover {
    transform: translateY(-4px) scale(1.005);
    border-color: var(--border-hover);
    box-shadow: 0 8px 22px var(--primary-glow);
}

.course-card-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.course-card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text-primary);
}

.course-card-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.course-card-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-delete {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.25);
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.75rem;
    font-weight: 700;
    transition: var(--transition-smooth);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.btn-delete:hover {
    background: #ef4444;
    color: white;
    border-color: #ef4444;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
    transform: scale(1.04);
}

/* تنسيقات جدول لوحة المشرف المتقدمة */
.admin-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.admin-table th, .admin-table td {
    padding: 12px 15px;
    border-bottom: 1px solid var(--border-color);
    text-align: right;
}

.admin-table th {
    color: var(--text-secondary);
    font-weight: 700;
    background: rgba(255, 255, 255, 0.02);
}

.admin-table tr:hover {
    background: rgba(255, 255, 255, 0.03);
}

.admin-tab-content {
    animation: fadeIn 0.3s ease;
}

/* شاشة المفضلة والبحث الفارغة */
.empty-state {
    text-align: center;
    padding: 50px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.empty-icon {
    font-size: 55px;
    filter: drop-shadow(0 0 10px var(--primary-glow));
}

.empty-state h4 {
    font-size: 1.15rem;
    font-weight: 700;
}

.empty-state p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    max-width: 380px;
}

/* إحصائيات تفاعلية مصغرة للمكتبة */
.stats-bar {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-top: 40px;
    margin-bottom: 0px;
}

.stat-card {
    background: var(--bg-panel);
    backdrop-filter: blur(var(--blur-intensity));
    border: 1px solid var(--border-color);
    padding: 16px 20px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    box-shadow: var(--card-shadow);
    transition: var(--transition-smooth);
    color: inherit;
    font: inherit;
    text-align: right;
}

button.stat-card { cursor: pointer; }

.stat-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-hover);
}

.stat-icon {
    font-size: 26px;
    background: var(--primary-glow);
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stat-card:nth-child(2) .stat-icon { background: var(--accent-glow); }
.stat-card:nth-child(3) .stat-icon { background: var(--success-glow); }

.stat-info .stat-value {
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.25;
}

.stat-info .stat-label {
    font-size: 0.78rem;
    color: var(--text-secondary);
}

/* ==========================================================================
   تنسيق الهواتف الذكية (Mobile Floating Island Navigation)
   ========================================================================== */
@media (max-width: 768px) {
    .main-layout {
        grid-template-columns: 1fr;
        padding-bottom: 20px;
    }
    
    .stats-bar {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .stat-card {
        padding: 12px 14px;
        border-radius: 16px;
    }
    
    .stat-icon {
        font-size: 20px;
        width: 38px;
        height: 38px;
    }
    
    .stat-value {
        font-size: 1.1rem;
    }
    
    .stat-label {
        font-size: 0.62rem;
    }

    header {
        flex-direction: column;
        gap: 12px;
        padding: 15px;
        text-align: center;
        border-radius: 20px;
    }

    .header-actions {
        width: 100%;
        justify-content: center;
    }

    .welcome-title {
        font-size: 2.1rem;
    }

    .welcome-subtitle {
        font-size: 0.9rem;
    }
    
    .portal-banner {
        min-height: 250px;
        padding: 20px;
        border-radius: 20px;
    }
    
    .banner-title {
        font-size: 1.6rem;
    }
    
    .banner-desc {
        font-size: 0.85rem;
    }
    
    .student-welcome-box {
        padding: 12px 16px;
        border-radius: 12px;
    }
    
    .student-welcome-box h2 {
        font-size: 0.95rem;
    }
    
    .portal-grid {
        grid-template-columns: 1fr;
    }
    
    .portal-card {
        padding: 16px;
        border-radius: 18px;
        gap: 14px;
    }
    
    .p-card-icon {
        font-size: 28px;
        width: 50px;
        height: 50px;
        border-radius: 12px;
    }
    
    .p-card-info h3 {
        font-size: 1rem;
    }
    
    .p-card-info p {
        font-size: 0.78rem;
    }
}

/* تنسيقات كبسولات جدول رسوم الساعات الفاخرة */
.fees-college-tag {
    background: rgba(13, 148, 136, 0.12);
    border: 1px solid rgba(13, 148, 136, 0.25);
    color: #2dd4bf;
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    display: inline-block;
}

[data-theme="light"] .fees-college-tag {
    background: rgba(13, 148, 136, 0.08);
    color: #0d9488;
}

.fee-badge {
    padding: 5px 12px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 700;
    display: inline-block;
}

.fee-badge-low {
    background: rgba(16, 185, 129, 0.12);
    border: 1px solid rgba(16, 185, 129, 0.25);
    color: #34d399;
}

[data-theme="light"] .fee-badge-low {
    background: rgba(16, 185, 129, 0.08);
    color: #059669;
}

.fee-badge-mid {
    background: rgba(59, 130, 246, 0.12);
    border: 1px solid rgba(59, 130, 246, 0.25);
    color: #60a5fa;
}

[data-theme="light"] .fee-badge-mid {
    background: rgba(59, 130, 246, 0.08);
    color: #2563eb;
}

.fee-badge-high {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #f87171;
}

[data-theme="light"] .fee-badge-high {
    background: rgba(239, 68, 68, 0.08);
    color: #dc2626;
}

.min-badge {
    padding: 5px 14px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    display: inline-block;
    text-align: center;
    min-width: 50px;
}

.min-badge-jor {
    background: rgba(234, 179, 8, 0.12);
    border: 1px solid rgba(234, 179, 8, 0.25);
    color: #facc15;
}

[data-theme="light"] .min-badge-jor {
    background: rgba(234, 179, 8, 0.08);
    color: #ca8a04;
}

.min-badge-int {
    background: rgba(6, 182, 212, 0.12);
    border: 1px solid rgba(6, 182, 212, 0.25);
    color: #22d3ee;
}

[data-theme="light"] .min-badge-int {
    background: rgba(6, 182, 212, 0.08);
    color: #0891b2;
}

/* لوحة رسوم التسجيل والقبول الإضافية */
.registration-fees-panel {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(147, 51, 234, 0.05) 100%);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 20px;
    padding: 20px;
    margin-bottom: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .registration-fees-panel {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.04) 0%, rgba(147, 51, 234, 0.03) 100%);
    border: 1px solid rgba(59, 130, 246, 0.15);
}

.reg-panel-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 10px;
}

[data-theme="light"] .reg-panel-title {
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.reg-panel-title span {
    font-size: 1.5rem;
}

.reg-panel-title h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
}

.reg-fees-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
}

.reg-fee-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 12px 14px;
    border-radius: 12px;
}

[data-theme="light"] .reg-fee-item {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.reg-fee-icon {
    font-size: 1.1rem;
}

.reg-fee-details h4 {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.reg-fee-details p {
    font-size: 0.82rem;
    color: var(--text-primary);
    line-height: 1.4;
}

.reg-fee-details strong {
    color: #60a5fa;
}

[data-theme="light"] .reg-fee-details strong {
    color: #2563eb;
}

/* سحب وإفلات الدكاترة للمشرف */
.prof-card.dragging {
    opacity: 0.4;
    border: 2px dashed #8b5cf6 !important;
    transform: scale(0.98);
}
.drag-handle {
    user-select: none;
    transition: color 0.2s;
}
.drag-handle:hover {
    color: #a78bfa !important;
}
.btn-delete-prof {
    transition: background-color 0.2s, border-color 0.2s;
}
.btn-delete-prof:hover {
    background-color: rgba(239, 68, 68, 0.25) !important;
    border-color: rgba(239, 68, 68, 0.5) !important;
}

/* ==========================================================================
   الشريط العلوي وبطاقات الخدمات المصوّرة
   ========================================================================== */
.site-topbar {
    position: sticky;
    top: 12px;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 10px 16px;
    margin-bottom: 24px;
    border-radius: 22px;
    background: rgba(8, 15, 30, 0.82);
    border: 1px solid rgba(148, 163, 184, 0.16);
    box-shadow: 0 18px 50px rgba(2, 6, 23, 0.34);
    backdrop-filter: blur(22px) saturate(150%);
    -webkit-backdrop-filter: blur(22px) saturate(150%);
}

[data-theme="light"] .site-topbar {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(15, 23, 42, 0.1);
}

.site-topbar .brand {
    appearance: none;
    width: fit-content;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--text-primary);
    text-align: right;
    font: inherit;
}

.site-topbar .brand:focus-visible,
.site-nav-link:focus-visible,
.portal-card:focus-visible {
    outline: 3px solid rgba(96, 165, 250, 0.72);
    outline-offset: 3px;
}

.site-topbar .brand-icon {
    width: 46px;
    height: 46px;
    display: grid;
    place-items: center;
    flex: 0 0 46px;
    border-radius: 15px;
    font-family: var(--font-heading);
    font-size: 1.45rem;
    font-weight: 900;
    color: #fff;
    background: linear-gradient(145deg, #2563eb, #7c3aed);
    box-shadow: 0 10px 25px rgba(79, 70, 229, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.28);
}

.site-topbar .brand-info p {
    display: none !important;
}

.site-nav {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 3px !important;
    padding: 2px !important;
    border-radius: 15px;
    background: transparent !important;
    border: none !important;
}

.site-nav-link {
    appearance: none;
    border: 0;
    border-radius: 9px;
    padding: 6px 9px !important;
    background: transparent;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.77rem !important;
    font-weight: 800;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.site-nav-link:hover {
    color: var(--text-primary);
    background: rgba(96, 165, 250, 0.09);
}

.site-nav-link.active {
    color: #fff;
    background: linear-gradient(135deg, #2563eb, #6d28d9);
    box-shadow: 0 8px 20px rgba(79, 70, 229, 0.28);
}

.site-topbar .header-actions {
    justify-self: end;
}

.site-topbar #admin-mode-toggle-btn {
    display: none !important;
}

.portal-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.portal-card {
    position: relative;
    min-width: 0;
    min-height: 390px;
    padding: 0;
    gap: 0;
    align-items: stretch;
    justify-content: flex-start;
    overflow: hidden;
    text-align: right;
    border-radius: 26px;
    background: rgba(15, 23, 42, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.14);
    box-shadow: 0 18px 45px rgba(2, 6, 23, 0.28);
    isolation: isolate;
}

[data-theme="light"] .portal-card {
    background: rgba(255, 255, 255, 0.92);
    border-color: rgba(15, 23, 42, 0.08);
}

.portal-card:hover {
    transform: translateY(-7px);
    border-color: rgba(96, 165, 250, 0.42);
    background: rgba(15, 23, 42, 0.78);
    box-shadow: 0 24px 55px rgba(15, 23, 42, 0.42), 0 0 0 1px rgba(96, 165, 250, 0.08);
}

.portal-card-media {
    position: relative;
    min-height: 245px;
    overflow: hidden;
    background: #0b1220;
}

.portal-card-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scale(1.015);
    transition: transform 0.65s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.4s ease;
}

.portal-card:hover .portal-card-image {
    transform: scale(1.075);
    filter: saturate(1.08);
}

.portal-card-media-shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(2, 6, 23, 0.12) 0%, rgba(2, 6, 23, 0.2) 38%, rgba(2, 6, 23, 0.96) 100%),
        linear-gradient(115deg, rgba(37, 99, 235, 0.12), transparent 55%);
}

.portal-card-badge-row {
    position: absolute;
    top: 16px;
    right: 16px;
    left: 16px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.portal-card-kicker {
    padding: 6px 10px;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.92);
    background: rgba(2, 6, 23, 0.44);
    backdrop-filter: blur(10px);
    font-size: 0.68rem;
    font-weight: 800;
}

.portal-card .p-card-icon {
    width: 46px;
    height: 46px;
    margin: 0;
    padding: 10px;
    border-radius: 14px;
    color: var(--service-color);
    background: rgba(2, 6, 23, 0.58);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 10px 25px rgba(2, 6, 23, 0.35);
    backdrop-filter: blur(12px);
}

.portal-card .p-card-icon svg {
    width: 25px !important;
    height: 25px !important;
}

.portal-card:hover .p-card-icon {
    transform: translateY(-2px) scale(1.04);
}

.portal-card-title-wrap {
    position: absolute;
    z-index: 2;
    right: 20px;
    left: 20px;
    bottom: 18px;
}

.portal-card-title-wrap h3 {
    max-width: 92%;
    margin: 0;
    color: #fff;
    font-family: var(--font-heading);
    font-size: clamp(1.16rem, 1.8vw, 1.42rem);
    font-weight: 900;
    line-height: 1.35;
    text-shadow: 0 3px 16px rgba(0, 0, 0, 0.68);
}

.portal-card-body {
    min-height: 140px;
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: space-between;
    gap: 16px;
    padding: 18px 20px 20px;
}

.portal-card-body p {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: var(--text-secondary);
    font-size: 0.84rem;
    line-height: 1.75;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.portal-card-link {
    width: fit-content;
    margin: 0;
    padding: 7px 11px;
    border-radius: 10px;
    color: #93c5fd;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(96, 165, 250, 0.14);
    font-size: 0.78rem;
    font-weight: 850;
}

.portal-card:hover .portal-card-link {
    color: #fff;
    background: rgba(59, 130, 246, 0.22);
}

@media (max-width: 1080px) {
    .site-topbar {
        grid-template-columns: 1fr auto;
    }

    .site-nav {
        grid-column: 1 / -1;
        grid-row: 2;
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        scrollbar-width: none;
    }

    .site-nav::-webkit-scrollbar {
        display: none;
    }

    .portal-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .app-container {
        padding: 12px;
    }

    .site-topbar {
        top: 7px;
        gap: 10px;
        padding: 10px;
        border-radius: 18px;
    }

    .site-topbar .brand {
        gap: 10px;
    }

    .site-topbar .brand-icon {
        width: 41px;
        height: 41px;
        flex-basis: 41px;
        border-radius: 13px;
        font-size: 1.25rem;
    }

    .site-topbar .brand-info h2 {
        font-size: 1rem !important;
    }

    .site-topbar .brand-info p {
        display: none;
    }

    .site-topbar .header-actions {
        width: auto;
        justify-content: flex-end;
    }

    .site-nav {
        padding: 4px;
    }

    .site-nav-link {
        padding: 8px 11px;
        font-size: 0.72rem;
    }

    .portal-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .portal-card {
        min-height: 355px;
        padding: 0;
        border-radius: 22px;
    }

    .portal-card-media {
        min-height: 220px;
    }

    .portal-card-title-wrap h3 {
        font-size: 1.22rem;
    }

    .portal-card-body {
        min-height: 130px;
        padding: 16px 18px 18px;
    }
}

/* ==========================================================================
   Final premium cascade
   تثبيت النظام الموحّد بعد التنسيقات التاريخية للمشروع
   ========================================================================== */
.app-container {
    width: min(100%, 1480px);
    margin-inline: auto;
    padding: 18px clamp(16px, 2.5vw, 38px) 46px;
}

.site-topbar {
    border-color: var(--ui-border);
    background:
        linear-gradient(135deg, rgba(79, 124, 255, 0.08), transparent 45%),
        var(--ui-surface);
    backdrop-filter: blur(24px) saturate(145%);
    box-shadow: 0 18px 50px rgba(2, 6, 23, 0.3);
}

[data-theme="light"] .site-topbar {
    background:
        linear-gradient(135deg, rgba(37, 99, 235, 0.07), transparent 48%),
        var(--ui-surface);
}

.site-topbar .brand {
    padding: 5px 7px;
    border-radius: 17px;
}

.site-topbar .brand:hover {
    background: rgba(79, 124, 255, 0.08);
}

.site-nav {
    border-color: var(--ui-border);
    background: rgba(2, 6, 23, 0.28);
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.035);
}

[data-theme="light"] .site-nav {
    background: rgba(241, 245, 249, 0.82);
}

.site-nav-link {
    position: relative;
    isolation: isolate;
}

.site-nav-link::after {
    content: "";
    position: absolute;
    right: 24%;
    bottom: 4px;
    left: 24%;
    height: 2px;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--ui-cyan), #818cf8);
    opacity: 0;
    transform: scaleX(0.4);
    transition: var(--ui-ease);
}

.site-nav-link.active {
    background: linear-gradient(135deg, #4f7cff, #6d4ce8);
    box-shadow: 0 9px 24px rgba(79, 124, 255, 0.34);
}

.site-nav-link.active::after {
    opacity: 1;
    transform: scaleX(1);
}

.portal-card {
    border-color: var(--ui-border);
    background: var(--ui-surface);
    box-shadow: var(--ui-shadow-soft);
}

.portal-card:hover {
    border-color: var(--ui-border-strong);
    background: var(--ui-surface);
    box-shadow: 0 24px 55px rgba(37, 99, 235, 0.2);
}

.portal-card-media-shade {
    background:
        linear-gradient(to top, rgba(5, 10, 23, 0.98), rgba(5, 10, 23, 0.08) 68%),
        linear-gradient(140deg, rgba(79, 124, 255, 0.12), transparent 50%);
}

.portal-card .p-card-icon {
    border-color: color-mix(in srgb, var(--service-color) 55%, transparent);
    background: color-mix(in srgb, var(--service-color) 19%, rgba(3, 7, 18, 0.62));
    box-shadow: 0 12px 30px color-mix(in srgb, var(--service-color) 28%, transparent);
}

.portal-card-body {
    border-top: 1px solid rgba(148, 163, 184, 0.09);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.018), transparent);
}

.library-header-section {
    position: relative;
    overflow: hidden;
    padding: clamp(22px, 3vw, 32px);
    border: 1px solid var(--ui-border);
    border-radius: var(--ui-radius-lg);
    background:
        radial-gradient(circle at 8% 0%, rgba(79, 124, 255, 0.18), transparent 38%),
        var(--ui-surface);
    box-shadow: var(--ui-shadow-soft);
}

.college-card,
.course-card,
.book-card,
.prof-card,
.college-detail-header,
.tree-level-header,
.gpa-step-card,
.gpa-res-card,
.admin-card {
    border-color: var(--ui-border);
    background-color: var(--ui-surface);
    box-shadow: var(--ui-shadow-soft);
}

.college-card,
.course-card,
.book-card,
.prof-card,
.gpa-step-card,
.gpa-res-card {
    border-radius: var(--ui-radius-md);
}

.college-card:hover,
.course-card:hover,
.book-card:hover,
.prof-card:hover {
    border-color: var(--ui-border-strong);
    box-shadow: 0 22px 48px rgba(37, 99, 235, 0.16);
}

.college-card.tree-college-card,
.tree-major-card,
.tree-group-card {
    background-color: var(--ui-surface);
}

.tree-college-stat,
.library-tree-breadcrumb,
.tree-level-count {
    border-color: var(--ui-border);
    background-color: rgba(5, 12, 28, 0.38);
}

[data-theme="light"] .tree-college-stat,
[data-theme="light"] .library-tree-breadcrumb,
[data-theme="light"] .tree-level-count {
    background-color: rgba(241, 245, 249, 0.78);
}

.book-actions button,
.btn-contribute,
.btn-submit,
.gpa-calc-btn {
    min-height: 44px;
    border-radius: 13px;
}

.btn-read,
.btn-submit,
.gpa-calc-btn {
    background: linear-gradient(135deg, #4f7cff, #6d4ce8);
    box-shadow: 0 10px 24px rgba(79, 124, 255, 0.24);
}

.btn-read:hover,
.btn-submit:hover,
.gpa-calc-btn:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #6795ff, #7c5cef);
    box-shadow: 0 14px 30px rgba(79, 124, 255, 0.34);
}

.admin-table {
    border-collapse: separate !important;
    border-spacing: 0;
    overflow: hidden;
}

.admin-table thead {
    background: rgba(79, 124, 255, 0.075);
}

.admin-table th {
    color: #a9c3ff;
    font-weight: 800;
}

.admin-table tbody tr {
    transition: background-color var(--ui-ease);
}

.admin-table tbody tr:hover {
    background: rgba(79, 124, 255, 0.055);
}

.search-input,
.form-control,
.gpa-field input,
.gpa-clean-row input {
    min-height: 48px;
    border: 1px solid var(--ui-border);
    border-radius: 14px;
    background: rgba(4, 10, 24, 0.46);
    box-shadow: inset 0 1px rgba(255, 255, 255, 0.025);
}

[data-theme="light"] .search-input,
[data-theme="light"] .form-control,
[data-theme="light"] .gpa-field input,
[data-theme="light"] .gpa-clean-row input {
    background: rgba(248, 250, 252, 0.92);
}

.search-input:focus,
.form-control:focus,
.gpa-field input:focus,
.gpa-clean-row input:focus {
    border-color: #6694ff;
    background: color-mix(in srgb, var(--ui-surface-strong) 86%, transparent);
    box-shadow: var(--ui-ring);
}

.filter-tabs {
    padding: 7px;
    border-color: var(--ui-border);
    border-radius: 17px;
    background: var(--ui-surface);
    box-shadow: var(--ui-shadow-soft);
}

.filter-tab.active,
.filter-tab:hover {
    background: linear-gradient(135deg, #4f7cff, #6d4ce8);
    box-shadow: 0 8px 22px rgba(79, 124, 255, 0.3);
}

.upload-modal,
.app-dialog-overlay {
    inset: 0;
    width: 100%;
    height: 100%;
    padding: clamp(12px, 3vw, 28px);
    background:
        radial-gradient(circle at 50% 18%, rgba(79, 124, 255, 0.15), transparent 32%),
        rgba(2, 6, 18, 0.82);
    backdrop-filter: blur(18px) saturate(120%);
}

.upload-content,
.app-dialog-card {
    position: relative;
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 28px;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, 0.045), transparent 30%),
        var(--ui-surface-strong);
    box-shadow:
        0 40px 100px rgba(2, 6, 23, 0.64),
        inset 0 1px rgba(255, 255, 255, 0.06);
    animation: premiumModalIn 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.upload-content {
    width: min(100%, 620px);
    max-width: 620px;
    max-height: min(88vh, 820px);
    padding: 0;
    gap: 0;
}

#add-professor-modal .upload-content,
#upload-modal .upload-content,
#add-admin-file-modal .upload-content {
    max-width: 760px !important;
}

#add-exam-modal .upload-content,
#add-service-modal .upload-content {
    max-width: 660px !important;
}

.upload-header,
.reader-header {
    position: sticky;
    top: 0;
    z-index: 2;
    min-height: 76px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--ui-border);
    background:
        linear-gradient(90deg, rgba(79, 124, 255, 0.1), transparent 55%),
        color-mix(in srgb, var(--ui-surface-strong) 94%, transparent);
    backdrop-filter: blur(20px);
}

.upload-header::before,
.reader-header::before {
    content: "";
    position: absolute;
    right: 24px;
    bottom: -1px;
    width: 68px;
    height: 2px;
    border-radius: 99px;
    background: linear-gradient(90deg, var(--ui-cyan), var(--ui-accent-2));
}

.upload-form {
    gap: 17px;
    padding: 22px 24px 26px;
}

.upload-form .btn-submit,
.modal-form .btn-submit {
    width: 100%;
    min-height: 50px;
    margin-top: 4px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    background: linear-gradient(135deg, #4f7cff, #6d4ce8) !important;
    box-shadow: 0 12px 28px rgba(79, 124, 255, 0.27);
}

.btn-close-modal,
#btn-close-chatbot {
    flex: 0 0 40px;
    width: 40px;
    height: 40px;
    display: grid !important;
    place-items: center;
    padding: 0 !important;
    border: 1px solid var(--ui-border) !important;
    border-radius: 12px !important;
    color: transparent !important;
    background: rgba(148, 163, 184, 0.08) !important;
    font-size: 0 !important;
}

.btn-close-modal::before,
#btn-close-chatbot::before {
    content: "×";
    color: var(--text-secondary);
    font: 400 1.6rem/1 system-ui, sans-serif;
}

.btn-close-modal:hover,
#btn-close-chatbot:hover {
    transform: rotate(5deg) scale(1.04);
    border-color: rgba(248, 113, 113, 0.4) !important;
    background: rgba(239, 68, 68, 0.12) !important;
}

.download-toast {
    border-color: var(--ui-border-strong);
    border-radius: 18px;
    background: var(--ui-surface-strong);
    box-shadow: var(--ui-shadow);
}

.download-progress-bar {
    background: linear-gradient(90deg, #22d3ee, #4f7cff, #8b5cf6);
}

/* ==================== زر ونوافذ الدعم الفني عبر واتساب ==================== */
.whatsapp-support-widget {
    position: fixed;
    bottom: 24px;
    left: 24px;
    z-index: 99999 !important;
    font-family: 'Tajawal', 'Cairo', sans-serif;
}

.btn-whatsapp-trigger {
    display: flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #25d366, #128c7e);
    color: #ffffff !important;
    text-decoration: none !important;
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 12px 20px;
    border-radius: 99px;
    font-size: 0.92rem;
    font-weight: 800;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(37, 211, 102, 0.4);
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    position: relative;
    outline: none;
}

.btn-whatsapp-trigger:hover {
    transform: translateY(-3px) scale(1.03);
    box-shadow: 0 12px 30px rgba(37, 211, 102, 0.55);
    background: linear-gradient(135deg, #2cf476, #107c70);
}

.btn-whatsapp-trigger:active {
    transform: translateY(0) scale(0.98);
}

.wa-btn-icon {
    font-size: 1.25rem;
    line-height: 1;
}

.wa-pulse-badge {
    position: absolute;
    top: -3px;
    right: -3px;
    width: 12px;
    height: 12px;
    background: #ef4444;
    border: 2px solid #ffffff;
    border-radius: 50%;
    animation: waPulse 1.8s infinite;
}

@keyframes waPulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 8px rgba(239, 68, 68, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.whatsapp-support-popover {
    position: absolute;
    bottom: 64px;
    left: 0;
    width: 320px;
    background: #0f172a;
    border: 1px solid rgba(37, 211, 102, 0.35);
    border-radius: 18px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 0 0 20px rgba(37, 211, 102, 0.15);
    overflow: hidden;
    animation: waPopIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    transform-origin: bottom left;
}

@keyframes waPopIn {
    0% { opacity: 0; transform: scale(0.85) translateY(15px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.wa-popover-header {
    background: linear-gradient(135deg, #128c7e, #075e54);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    position: relative;
}

.wa-avatar-badge {
    position: relative;
    font-size: 1.5rem;
    background: rgba(255, 255, 255, 0.15);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wa-online-dot {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 10px;
    height: 10px;
    background: #25d366;
    border: 2px solid #075e54;
    border-radius: 50%;
}

.wa-header-info {
    display: flex;
    flex-direction: column;
    flex: 1;
}

.wa-header-info strong {
    font-size: 0.95rem;
    font-weight: 800;
}

.wa-header-info span {
    font-size: 0.76rem;
    opacity: 0.85;
}

.wa-close-btn {
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 1.4rem;
    cursor: pointer;
    opacity: 0.75;
    transition: opacity 0.2s;
    line-height: 1;
    padding: 2px 6px;
}

.wa-close-btn:hover {
    opacity: 1;
}

.wa-popover-body {
    padding: 16px;
    color: #e2e8f0;
}

.wa-popover-body p {
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 12px;
    color: #cbd5e1;
}

.wa-phone-box {
    background: rgba(255, 255, 255, 0.05);
    border: 1px dashed rgba(37, 211, 102, 0.4);
    border-radius: 10px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    font-size: 0.82rem;
}

.wa-phone-box strong {
    color: #34d399;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.5px;
}

.wa-chat-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #25d366;
    color: #052e16;
    text-decoration: none;
    font-size: 0.88rem;
    font-weight: 800;
    padding: 11px 16px;
    border-radius: 12px;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.wa-chat-link:hover {
    background: #34d399;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(37, 211, 102, 0.45);
}

@media (max-width: 640px) {
    .whatsapp-support-widget {
        bottom: 16px;
        left: 16px;
    }
    .whatsapp-support-popover {
        width: 280px;
        left: 0;
    }
}

@media (max-width: 700px) {
    .app-container {
        padding: 10px 12px 34px;
    }

    .upload-modal,
    .app-dialog-overlay {
        padding: 10px;
        align-items: flex-end;
    }

    .upload-content,
    .app-dialog-card {
        max-height: calc(100vh - 20px);
        border-radius: 24px 24px 18px 18px;
    }

    .upload-header,
    .reader-header {
        min-height: 54px;
        padding: 10px 14px;
    }

    .upload-form {
        padding: 18px;
    }

    .app-dialog-card {
        padding: 27px 20px 20px;
    }

    .app-dialog-actions {
        flex-direction: column-reverse;
    }

    #app-notifications-container {
        top: 12px;
        left: 12px;
        width: calc(100vw - 24px);
    }
}

/* ==================== أزرار الدعم الفني والمفضلة بالهيدر العلوي ==================== */
.site-topbar .brand {
    flex-shrink: 0 !important;
    min-width: max-content !important;
}

.site-topbar .header-actions {
    display: flex !important;
    align-items: center !important;
    gap: 5px !important;
    flex-wrap: nowrap !important;
    justify-content: flex-end !important;
    flex-shrink: 0 !important;
}

.header-action-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 3px !important;
    padding: 4px 9px !important;
    height: 32px !important;
    border-radius: 99px !important;
    font-size: 0.76rem !important;
    font-weight: 800 !important;
    cursor: pointer !important;
    text-decoration: none !important;
    transition: all 0.2s ease !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

.theme-toggle-btn,
#theme-toggle-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    border-radius: 50% !important;
    padding: 0 !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    background: rgba(255, 255, 255, 0.08) !important;
    color: #f8fafc !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    transition: all 0.2s ease !important;
}

.theme-toggle-btn:hover,
#theme-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.18) !important;
    transform: rotate(15deg);
}

.install-desktop-btn {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(99, 102, 241, 0.28)) !important;
    border-color: rgba(59, 130, 246, 0.5) !important;
    color: #60a5fa !important;
}

.install-desktop-btn:hover {
    background: linear-gradient(135deg, #3b82f6, #6366f1) !important;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(59, 130, 246, 0.4);
}

.wa-header-btn {
    background: linear-gradient(135deg, rgba(37, 211, 102, 0.18), rgba(18, 140, 126, 0.25)) !important;
    border-color: rgba(37, 211, 102, 0.4) !important;
    color: #34d399 !important;
}

.wa-header-btn:hover {
    background: linear-gradient(135deg, #25d366, #128c7e) !important;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 211, 102, 0.35);
}

.fav-header-btn {
    background: rgba(244, 63, 94, 0.15) !important;
    border-color: rgba(244, 63, 94, 0.4) !important;
    color: #fb7185 !important;
}

.fav-header-btn:hover {
    background: #f43f5e !important;
    color: #ffffff !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(244, 63, 94, 0.35);
}

#header-favorites-btn,
#theme-toggle-btn {
    display: inline-flex !important;
    visibility: visible !important;
    opacity: 1 !important;
    flex-shrink: 0 !important;
}

@media (max-width: 900px) {
    .header-action-btn {
        padding: 4px 7px !important;
        font-size: 0.72rem !important;
        height: 30px !important;
    }
}

@media (max-width: 680px) {
    .header-action-btn {
        padding: 0 !important;
        width: 30px !important;
        height: 30px !important;
        border-radius: 50% !important;
    }
    .header-action-btn .btn-full-label,
    .header-action-btn .btn-short-label {
        display: none !important;
    }
}

/* ==================== منع ظهور عناصر لوحة التحكم على بوابة الطالب بتاتاً ==================== */
#portal-admin-controls-bar,
#btn-open-admin-dashboard,
#admin-mode-toggle-btn,
#admin-view,
.admin-mode-bar,
.portal-admin-toolbar,
.prof-admin-bar,
.exams-admin-th {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
    height: 0 !important;
    width: 0 !important;
    overflow: hidden !important;
}

/* ==================== رسوم الساعات والتخصصات المتجاوبة بالهاتف ==================== */
@media (max-width: 768px) {
    .fees-responsive-table thead {
        display: none !important;
    }
    
    .fees-responsive-table, 
    .fees-responsive-table tbody, 
    .fees-responsive-table tr, 
    .fees-responsive-table td {
        display: block !important;
        width: 100% !important;
    }
    
    .fees-responsive-table tr {
        background: rgba(255, 255, 255, 0.02) !important;
        border: 1px solid rgba(255, 255, 255, 0.06) !important;
        border-radius: 16px !important;
        padding: 14px 16px !important;
        margin-bottom: 16px !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
        transition: transform 0.2s, background-color 0.2s !important;
    }
    
    .fees-responsive-table tr:hover {
        background: rgba(255, 255, 255, 0.04) !important;
        transform: translateY(-2px) !important;
    }
    
    .fees-responsive-table td {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 10px 0 !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.04) !important;
        text-align: left !important;
    }
    
    .fees-responsive-table td:last-child {
        border-bottom: none !important;
    }
    
    /* عرض المسمى/العنوان لكل عمود تلقائياً على الهواتف */
    .fees-responsive-table td::before {
        content: attr(data-label) !important;
        font-weight: 800 !important;
        color: #94a3b8 !important;
        font-size: 0.82rem !important;
        text-align: right !important;
        margin-left: 10px !important;
    }
}

/* ==================== المراقبة الذكية لمواعيد الامتحانات للمواد المفضلة ==================== */
.bookmarks-exam-smart-tracker-banner {
    grid-column: 1 / -1;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.12), rgba(139, 92, 246, 0.12));
    border: 1px dashed rgba(139, 92, 246, 0.4);
    border-radius: 16px;
    padding: 14px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.1);
}

.bookmarks-exam-smart-tracker-banner .tracker-icon {
    font-size: 1.8rem;
    background: rgba(139, 92, 246, 0.2);
    border-radius: 12px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    animation: pulseRing 2s infinite ease-in-out;
}

@keyframes pulseRing {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.08); }
}

.bookmarks-exam-smart-tracker-banner .tracker-info h4 {
    margin: 0 0 3px 0;
    font-size: 0.95rem;
    font-weight: 800;
    color: #c4b5fd;
    display: flex;
    align-items: center;
    gap: 6px;
}

.bookmarks-exam-smart-tracker-banner .tracker-info p {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.45;
}

/* صندوق تفاصيل الامتحان داخل كرت المرجع المفضّل */
.book-exam-schedule-box {
    margin: 10px 0 6px 0;
    background: rgba(16, 185, 129, 0.08);
    border: 1px solid rgba(16, 185, 129, 0.25);
    border-radius: 12px;
    padding: 10px 12px;
    font-size: 0.78rem;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.book-exam-schedule-box .exam-box-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2px;
}

.badge-exam-status {
    background: #10b981;
    color: #fff;
    font-weight: 800;
    font-size: 0.72rem;
    padding: 2px 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}

.book-exam-schedule-box .exam-detail-item {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--text-primary);
    line-height: 1.4;
}

.book-exam-schedule-box .exam-detail-item strong {
    color: #6ee7b7;
    font-weight: 700;
}

.book-exam-pending-box {
    margin: 8px 0 4px 0;
    background: rgba(245, 158, 11, 0.06);
    border: 1px dashed rgba(245, 158, 11, 0.25);
    border-radius: 10px;
    padding: 7px 10px;
    font-size: 0.75rem;
    color: #fcd34d;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ==========================================================================
   ✨ Ultra-Modern GPA Calculator, Professors & Academic Visual Polish
   ========================================================================== */

/* حاسبة المعدل التراكمي الفاخرة */
.gpa-card-main {
    border-radius: 24px !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    background: linear-gradient(145deg, rgba(30, 41, 59, 0.6) 0%, rgba(15, 23, 42, 0.75) 100%) !important;
    backdrop-filter: blur(24px) !important;
    box-shadow: 0 20px 40px -15px rgba(0, 0, 0, 0.5) !important;
}

.gpa-result-dial {
    border-radius: 20px !important;
    background: radial-gradient(circle at center, rgba(59, 130, 246, 0.15) 0%, rgba(15, 23, 42, 0.6) 100%) !important;
    border: 1px solid rgba(59, 130, 246, 0.3) !important;
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.2) !important;
}

/* دليل الدكاترة والمدرسين */
.professor-card {
    border-radius: 20px !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    background: linear-gradient(165deg, rgba(30, 41, 59, 0.45) 0%, rgba(15, 23, 42, 0.65) 100%) !important;
    backdrop-filter: blur(16px) !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3) !important;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease !important;
}

.professor-card:hover {
    transform: translateY(-4px) scale(1.01) !important;
    border-color: rgba(56, 189, 248, 0.4) !important;
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.5), 0 0 25px rgba(56, 189, 248, 0.15) !important;
}

/* جدول الرسوم وجداول الامتحانات */
.fees-table-container,
.exams-table-container {
    border-radius: 20px !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    background: rgba(15, 23, 42, 0.65) !important;
    backdrop-filter: blur(20px) !important;
    overflow: hidden !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35) !important;
}


/* ==========================================================================
   ✍️ القارئ الرقمي التفاعلي وأدوات الرسم والكتابة وتدوين الملاحظات
   ========================================================================== */

.tool-action-btn {
    background: rgba(30, 41, 59, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: all 0.2s ease;
}

.tool-action-btn:hover {
    background: rgba(59, 130, 246, 0.25);
    border-color: #3b82f6;
    color: #ffffff;
    transform: translateY(-1px);
}

.tool-action-btn.is-active {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    border-color: #60a5fa;
    color: #ffffff;
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.btn-danger-tool {
    background: rgba(239, 68, 68, 0.15) !important;
    border-color: rgba(239, 68, 68, 0.35) !important;
    color: #f87171 !important;
}
.btn-danger-tool:hover {
    background: #ef4444 !important;
    color: #ffffff !important;
}

.btn-success-tool {
    background: rgba(34, 197, 94, 0.18) !important;
    border-color: rgba(34, 197, 94, 0.4) !important;
    color: #4ade80 !important;
}
.btn-success-tool:hover {
    background: #22c55e !important;
    color: #ffffff !important;
}

.tool-separator {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, 0.15);
    margin: 0 4px;
}

.color-dot {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s ease;
}

.color-dot:hover {
    transform: scale(1.18);
}

.color-dot.is-selected {
    border-color: #ffffff;
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.8);
    transform: scale(1.15);
}

.tool-select {
    background: #1e293b;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #ffffff;
    padding: 5px 8px;
    border-radius: 8px;
    font-size: 0.78rem;
    font-weight: 700;
    cursor: pointer;
}

.is-active-mode {
    background: linear-gradient(135deg, #8b5cf6 0%, #6366f1 100%) !important;
    color: #ffffff !important;
    border-color: #a78bfa !important;
}

/* بطاقة الملاحظة اللاصقة المكتوبة (Sticky Note) */
.sticky-note-card {
    position: absolute;
    background: #fef08a;
    color: #854d0e;
    border: 1px solid #facc15;
    border-radius: 8px;
    padding: 8px 10px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.25);
    width: 200px;
    pointer-events: auto;
    font-size: 0.8rem;
    line-height: 1.4;
    cursor: move;
    z-index: 20;
    animation: fadeIn 0.2s ease;
}

.sticky-note-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px dashed rgba(133, 77, 14, 0.25);
    padding-bottom: 4px;
    margin-bottom: 6px;
    font-weight: 800;
    font-size: 0.72rem;
}

.btn-delete-note {
    background: none;
    border: none;
    cursor: pointer;
    color: #dc2626;
    font-weight: 900;
    font-size: 0.85rem;
    line-height: 1;
}

.sticky-note-textarea {
    width: 100%;
    background: transparent;
    border: none;
    outline: none;
    resize: none;
    color: #713f12;
    font-family: inherit;
    font-size: 0.78rem;
    min-height: 60px;
}

/* ==================== 📓 SmartNote Pro Global Styles ==================== */
#reader-board-wrapper {
    transition: background-color 0.25s ease, background-image 0.25s ease;
    user-select: none;
    -webkit-user-select: none;
}

#reader-board-canvas {
    width: 100%;
    height: 100%;
    touch-action: none;
}

.notebook-toolbar .tool-action-btn.is-active {
    background: linear-gradient(135deg, #3b82f6, #6366f1) !important;
    color: #ffffff !important;
    border-color: #818cf8 !important;
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}

.notebook-toolbar .tool-select:focus {
    outline: none;
    border-color: #38bdf8;
}

.notebook-toolbar .color-dot {
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.notebook-toolbar .color-dot:hover {
    transform: scale(1.2);
}

.notebook-toolbar .color-dot.is-selected {
    transform: scale(1.25);
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9), 0 2px 8px rgba(0, 0, 0, 0.4);
}

#starnote-pagination-group button:hover {
    background: rgba(255, 255, 255, 0.15) !important;
}

/* ==========================================================================
   🌟 تحسينات تجربة الطالب العالمية الشاملة (World-Class Student Delight Experience)
   ========================================================================== */

/* 1. تأثيرات الصقل والعمق البصري للبطاقات (Glassmorphism 2.0 & Smooth Lifts) */
.portal-card,
.college-card,
.course-card,
.service-card,
.doctor-card,
.exam-row-card {
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease !important;
    will-change: transform, box-shadow;
}

.portal-card:hover,
.college-card:hover,
.course-card:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 16px 36px -10px rgba(0, 0, 0, 0.35), 0 0 20px rgba(59, 130, 246, 0.15) !important;
    border-color: rgba(99, 102, 241, 0.45) !important;
}

/* 2. تمييز الكلمات المطابقة في البحث الذكي (Search Highlighting) */
.search-highlight {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.28), rgba(217, 119, 6, 0.22));
    color: #fbbf24;
    font-weight: 800;
    padding: 1px 4px;
    border-radius: 4px;
    border: 1px solid rgba(245, 158, 11, 0.35);
}

/* 3. شارات متألقة وأنيقة (Jewel-toned Badges & Smooth Pills) */
.badge-pill,
.tree-badge,
.classification-badge {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    letter-spacing: -0.01em;
    font-feature-settings: "tnum";
}

/* 4. شريط تمرير أنيق ونحيف مريح للعين (Sleek Minimal Scrollbars) */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.25);
    border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(148, 163, 184, 0.45);
}

/* 5. تركيز لوحة المفاتيح لإمكانية الوصول الفائقة (Accessibility Focus Rings) */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 2px solid #60a5fa !important;
    outline-offset: 2px !important;
}

/* 6. تحسين انسيابية التنقل وسرعة الاستجابة */
html {
    scroll-behavior: smooth;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

/* 7. وضع القراءة والتركيز الكامل لملفات PDF والملخصات */
body.reader-focus-mode #reader-side-notebook {
    display: none !important;
}

body.reader-focus-mode #reader-left-pane {
    width: 100% !important;
    max-width: 100% !important;
    flex: 1 1 100% !important;
}

body.reader-focus-mode .pdf-rendered-page-card {
    max-width: 960px !important;
    margin: 20px auto !important;
}

/* 8. كبسولة وعداد مؤقت التركيز العائم (Floating Focus Bar & Live Timer) */
.floating-focus-bar {
    position: fixed;
    top: 18px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99998;
    background: rgba(15, 23, 42, 0.92);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1.5px solid rgba(245, 158, 11, 0.7);
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.6), 0 0 20px rgba(245, 158, 11, 0.3);
    border-radius: 999px;
    padding: 8px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
    direction: rtl;
    animation: slideDownFocus 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    transition: all 0.25s ease;
}

.floating-focus-bar:hover {
    border-color: #f59e0b;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.75), 0 0 25px rgba(245, 158, 11, 0.45);
    transform: translateX(-50%) translateY(-2px);
}

.floating-focus-bar.is-paused {
    border-color: rgba(148, 163, 184, 0.4);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
}

@keyframes slideDownFocus {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(-30px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0) scale(1);
    }
}

@keyframes pulseGlow {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 2px rgba(245, 158, 11, 0.6));
    }
    50% {
        transform: scale(1.15);
        filter: drop-shadow(0 0 8px rgba(245, 158, 11, 1));
    }
}

.pomodoro-active-header {
    border-color: #f59e0b !important;
    background: rgba(245, 158, 11, 0.22) !important;
    box-shadow: 0 0 14px rgba(245, 158, 11, 0.45) !important;
}

.pomodoro-active-header .btn-icon {
    animation: pulseGlow 1.5s infinite;
}