/* ===== RESET & BASE ===== */
:root {
    --primary: #4A6CF7;
    --primary-light: #6A8BFF;
    --primary-dark: #3A5BD6;
    --secondary: #6C63FF;
    --accent: #FF6B8B;
    --success: #2ECC71;
    --warning: #F39C12;
    --danger: #E74C3C;
    --dark: #2C3E50;
    --light: #F8F9FA;
    --gray: #95A5A6;
    --border: #E0E0E0;
    
    --shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 40px rgba(0, 0, 0, 0.12);
    --radius: 12px;
    --transition: all 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
}

body {
    font-family: 'Cairo', sans-serif;
    background: var(--light);
    color: var(--dark);
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 20% 80%, rgba(74, 108, 247, 0.05) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(108, 99, 255, 0.05) 0%, transparent 50%);
    z-index: -1;
    pointer-events: none;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slideInLeft {
    from { opacity: 0; transform: translateX(-50px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(50px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    33% { transform: translateY(-20px) rotate(120deg); }
    66% { transform: translateY(10px) rotate(240deg); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.05); opacity: 0.8; }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

@keyframes typing {
    from { width: 0; }
    to { width: 100%; }
}

@keyframes blink-caret {
    from, to { border-color: transparent; }
    50% { border-color: var(--primary); }
}

@keyframes scroll {
    0% { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(20px); }
}

.animate-on-scroll {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.animate-on-scroll.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===== PRELOADER ===== */
.preloader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--light);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.loader .book {
    width: 60px;
    height: 45px;
    position: relative;
    margin: 0 auto;
    perspective: 120px;
}

.loader .inner {
    position: absolute;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    animation: spin 1.2s infinite;
}

.loader .inner .left,
.loader .inner .middle,
.loader .inner .right {
    position: absolute;
    width: 20px;
    height: 45px;
    background: var(--primary);
    border-radius: 4px;
}

.loader .inner .left { transform: rotateY(0deg) translateZ(20px); }
.loader .inner .middle { transform: rotateY(90deg) translateZ(20px); }
.loader .inner .right { transform: rotateY(180deg) translateZ(20px); }

.loader ul {
    margin: 0;
    padding: 0;
    position: absolute;
    left: 50%;
    top: 0;
}

.loader ul li {
    list-style: none;
    position: absolute;
    top: 0;
    width: 2px;
    height: 15px;
    background: var(--dark);
    opacity: 0.5;
    transform-origin: 50% 25px;
}

.loader p {
    margin-top: 80px;
    font-size: 1.1rem;
    color: var(--primary);
    text-align: center;
    animation: pulse 2s infinite;
}

/* ===== NAVIGATION ===== */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow);
    z-index: 1000;
    transition: var(--transition);
}

.navbar.scrolled {
    padding: 0.5rem 0;
    background: rgba(255, 255, 255, 0.98);
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: var(--transition);
}

.logo:hover { transform: translateY(-2px); }

.logo-icon {
    width: 45px;
    height: 45px;
    background: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    transition: var(--transition);
}

.logo:hover .logo-icon { transform: rotate(360deg); }

.logo-text {
    display: flex;
    flex-direction: column;
}

.logo-name {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--primary);
}

.logo-tag {
    font-size: 0.9rem;
    color: var(--gray);
    font-weight: 500;
}

.nav-menu {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.nav-link {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.8rem 1.2rem;
    color: var(--dark);
    text-decoration: none;
    font-weight: 600;
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
}

.nav-link::before {
    content: attr(data-text);
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    transition: transform 0.3s ease;
}

.nav-link:hover::before { transform: translateY(-100%); }
.nav-link.active { background: var(--primary); color: white; }
.nav-link i { font-size: 1.1rem; transition: var(--transition); }
.nav-link:hover i { transform: scale(1.2); }

/* القوائم المنسدلة */
.nav-dropdown { position: relative; }
.nav-dropdown .dropdown-toggle { display: flex; align-items: center; gap: 5px; }
.nav-dropdown .dropdown-arrow { font-size: 0.8rem; transition: transform 0.3s ease; }
.nav-dropdown:hover .dropdown-arrow { transform: rotate(180deg); }

.nav-dropdown .dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 250px;
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 0.5rem 0;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
    border: 1px solid var(--border);
}

.nav-dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* عناصر القائمة داخل dropdown */
.nav-dropdown .dropdown-menu .university-subject-item {
    padding: 0.8rem 1.2rem;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    transition: background 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--dark);
}

.nav-dropdown .dropdown-menu .university-subject-item:last-child { border-bottom: none; }
.nav-dropdown .dropdown-menu .university-subject-item:hover { background: #f8f9ff; }

.nav-dropdown .dropdown-menu .subject-icon {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    color: white;
    flex-shrink: 0;
}

.nav-dropdown .dropdown-menu .subject-info h4 {
    font-size: 0.95rem;
    margin: 0 0 0.2rem;
    color: var(--dark);
}

.nav-dropdown .dropdown-menu .subject-info p {
    font-size: 0.8rem;
    color: var(--gray);
    margin: 0;
}

/* أزرار الإجراءات */
.nav-actions { display: flex; align-items: center; gap: 1rem; }
.theme-toggle {
    width: 45px; height: 45px; background: var(--light); border-radius: 50%;
    display: flex; align-items: center; justify-content: center; cursor: pointer;
    font-size: 1.2rem; color: var(--dark); transition: var(--transition);
    box-shadow: var(--shadow);
}
.theme-toggle:hover { transform: rotate(30deg); background: var(--primary); color: white; }

.menu-toggle {
    display: none; flex-direction: column; gap: 6px; background: none; border: none;
    cursor: pointer; padding: 0.5rem;
}
.menu-toggle span {
    width: 25px; height: 3px; background: var(--dark); border-radius: 2px;
    transition: var(--transition);
}
.menu-toggle.active span:nth-child(1) { transform: rotate(45deg) translate(6px, 6px); }
.menu-toggle.active span:nth-child(2) { opacity: 0; }
.menu-toggle.active span:nth-child(3) { transform: rotate(-45deg) translate(6px, -6px); }

/* ===== HERO SECTION ===== */
.hero {
    min-height: 100vh; padding: 120px 2rem 4rem; display: flex; align-items: center;
    justify-content: center; position: relative; overflow: hidden;
}
.hero::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(135deg, rgba(74,108,247,0.05) 0%, rgba(108,99,255,0.05) 50%, rgba(255,107,139,0.05) 100%);
    z-index: -1;
}
.hero-content { max-width: 1400px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 4rem; align-items: center; }
.hero-text { text-align: right; }
.hero-title { font-size: 3.5rem; margin-bottom: 1.5rem; line-height: 1.2; }
.gradient-text { color: var(--primary); }
.typing-text {
    display: inline-block; overflow: hidden; border-right: 3px solid var(--primary);
    white-space: nowrap; animation: typing 3.5s steps(40, end), blink-caret .75s step-end infinite;
}
.hero-subtitle { font-size: 1.3rem; color: var(--gray); margin-bottom: 2.5rem; line-height: 1.8; }
.hero-buttons { display: flex; gap: 1.5rem; flex-wrap: wrap; }
.btn {
    display: inline-flex; align-items: center; gap: 10px; padding: 1rem 2.5rem;
    border-radius: 50px; text-decoration: none; font-weight: 700; font-size: 1.1rem;
    transition: var(--transition); border: none; cursor: pointer; position: relative;
    overflow: hidden;
}
.btn::before {
    content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    transition: left 0.7s;
}
.btn:hover::before { left: 100%; }
.btn-primary {
    background: var(--primary); color: white; border: 2px solid var(--primary);
    box-shadow: 0 10px 30px rgba(74,108,247,0.3);
}
.btn-primary:hover {
    background: var(--primary-dark); border-color: var(--primary-dark);
    transform: translateY(-5px); box-shadow: 0 15px 40px rgba(74,108,247,0.4);
}
.btn-secondary { background: white; color: var(--primary); border: 2px solid var(--primary); }
.btn-secondary:hover { background: var(--primary); color: white; transform: translateY(-5px); box-shadow: 0 15px 40px rgba(74,108,247,0.2); }
.btn-success { background: var(--success); color: white; border: 2px solid var(--success); }
.btn-success:hover { background: #27AE60; border-color: #27AE60; transform: translateY(-5px); box-shadow: 0 15px 40px rgba(46,204,113,0.3); }

.hero-image { position: relative; display: flex; justify-content: center; align-items: center; }
.floating-element {
    position: absolute; width: 80px; height: 80px; background: var(--primary);
    border-radius: 20px; display: flex; align-items: center; justify-content: center;
    font-size: 2rem; color: white; border: 2px solid white;
    box-shadow: 0 5px 15px rgba(74,108,247,0.3); animation: float 6s ease-in-out infinite;
}
.floating-element:nth-child(1) { top: 20%; left: 10%; animation-delay: 0s; }
.floating-element:nth-child(2) { top: 60%; right: 15%; animation-delay: 2s; background: var(--secondary); }
.floating-element:nth-child(3) { bottom: 20%; left: 20%; animation-delay: 4s; background: var(--accent); }

.scroll-indicator {
    position: absolute; bottom: 2rem; left: 50%; transform: translateX(-50%);
    display: flex; flex-direction: column; align-items: center; gap: 10px; color: var(--gray);
    animation: bounce 2s infinite;
}
.mouse { width: 30px; height: 50px; border: 2px solid var(--gray); border-radius: 15px; position: relative; }
.wheel {
    width: 4px; height: 10px; background: var(--primary); border-radius: 2px;
    position: absolute; top: 10px; left: 50%; transform: translateX(-50%);
    animation: scroll 2s infinite;
}
.hero-waves { position: absolute; bottom: 0; left: 0; width: 100%; height: 150px; overflow: hidden; line-height: 0; }
.hero-waves svg { position: relative; display: block; width: calc(100% + 1.3px); height: 150px; transform: rotate(180deg); }
.hero-waves path { fill: var(--light); }

/* ===== SECTIONS COMMON ===== */
section { padding: 5rem 2rem; }
.section-header { text-align: center; margin-bottom: 3rem; }
.section-title {
    font-size: 2.5rem; margin-bottom: 1rem; display: flex; align-items: center;
    justify-content: center; gap: 1rem; color: var(--dark);
}
.title-decorator { width: 50px; height: 4px; background: var(--primary); border-radius: 2px; }
.section-subtitle { font-size: 1.2rem; color: var(--gray); max-width: 600px; margin: 0 auto; }

/* ===== STATS SECTION ===== */
.stats-section { background: var(--primary); color: white; position: relative; overflow: hidden; }
.stats-section::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: url('data:image/svg+xml,<svg width="20" height="20" xmlns="http://www.w3.org/2000/svg"><rect width="20" height="20" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></svg>');
}
.stats-container {
    max-width: 1200px; margin: 0 auto; display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 2rem; position: relative; z-index: 1;
}
.stat-card {
    background: rgba(255,255,255,0.1); backdrop-filter: blur(10px); border-radius: var(--radius);
    padding: 2rem; text-align: center; transition: var(--transition); border: 1px solid rgba(255,255,255,0.2);
}
.stat-card:hover { transform: translateY(-10px); background: rgba(255,255,255,0.2); box-shadow: 0 20px 40px rgba(0,0,0,0.2); }
.stat-icon {
    width: 70px; height: 70px; background: white; border-radius: 50%; display: flex;
    align-items: center; justify-content: center; margin: 0 auto 1.5rem; font-size: 1.8rem;
    color: var(--primary); transition: var(--transition);
}
.stat-card:hover .stat-icon { transform: scale(1.1) rotate(360deg); }
.stat-number { font-size: 3rem; font-weight: 800; margin-bottom: 0.5rem; color: white; }
.stat-label { font-size: 1.1rem; opacity: 0.9; }

/* ===== PERMANENT UNIVERSITY SUBJECTS ===== */
.university-categories.permanent {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 2rem; margin-top: 2rem;
}
.category-block { background: white; border-radius: 20px; padding: 1.5rem; box-shadow: var(--shadow); border: 1px solid var(--border); }
.category-title {
    font-size: 1.4rem; margin-bottom: 1.5rem; color: var(--primary); display: flex;
    align-items: center; gap: 10px; padding-bottom: 1rem; border-bottom: 2px solid var(--primary-light);
}
.subjects-list { display: flex; flex-direction: column; gap: 0.8rem; }
.subjects-list .university-subject-item {
    display: flex; align-items: center; gap: 1rem; padding: 0.8rem 1rem;
    background: #f8f9ff; border-radius: 12px; transition: all 0.3s ease;
    text-decoration: none; color: var(--dark);
}
.subjects-list .university-subject-item:hover { background: var(--primary); color: white; transform: translateX(-5px); }
.subjects-list .university-subject-item .subject-icon {
    width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center;
    justify-content: center; font-size: 1.2rem; color: white; flex-shrink: 0;
}
.subjects-list .university-subject-item .subject-info h4 { margin: 0 0 0.2rem; font-size: 1.1rem; }
.subjects-list .university-subject-item .subject-info p { margin: 0; font-size: 0.9rem; opacity: 0.8; }

/* ===== GENERAL SUBJECTS SECTION ===== */
.subjects-filter { display: flex; justify-content: center; gap: 1rem; margin-bottom: 3rem; flex-wrap: wrap; }
.filter-btn {
    padding: 0.8rem 2rem; background: white; border: 2px solid var(--primary);
    border-radius: 50px; color: var(--primary); font-weight: 600; cursor: pointer;
    transition: var(--transition);
}
.filter-btn:hover, .filter-btn.active { background: var(--primary); color: white; transform: translateY(-3px); box-shadow: var(--shadow); }
.subjects-grid {
    max-width: 1400px; margin: 0 auto; display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 2rem;
}
.subject-card {
    background: white; border-radius: var(--radius); padding: 2rem; text-align: center;
    transition: var(--transition); box-shadow: var(--shadow); position: relative;
    overflow: hidden; cursor: pointer; border-top: 4px solid var(--primary);
    text-decoration: none; color: var(--dark); display: block;
}
.subject-card::before {
    content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 4px;
    background: var(--primary); transition: left 0.3s ease;
}
.subject-card:hover::before { left: 0; }
.subject-card:hover { transform: translateY(-10px) scale(1.02); box-shadow: var(--shadow-lg); }
.subject-icon {
    width: 80px; height: 80px; background: var(--primary); border-radius: 50%;
    display: flex; align-items: center; justify-content: center; margin: 0 auto 1.5rem;
    font-size: 2rem; color: white; transition: var(--transition);
}
.subject-card:hover .subject-icon { transform: scale(1.1) rotateY(180deg); background: var(--primary-dark); }
.subject-name { font-size: 1.5rem; margin-bottom: 1rem; color: var(--dark); }
.subject-description { color: var(--gray); margin-bottom: 1.5rem; line-height: 1.6; }
.subject-stats {
    display: flex; justify-content: space-between; align-items: center;
    padding-top: 1.5rem; border-top: 1px solid rgba(0,0,0,0.1);
}
.stat-item { display: flex; flex-direction: column; align-items: center; gap: 5px; }
.stat-count { font-weight: 700; color: var(--primary); font-size: 1.2rem; }
.stat-label { font-size: 0.9rem; color: var(--gray); }

/* ===== FILES SECTION ===== */
.files-grid {
    max-width: 1400px; margin: 0 auto; display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 2rem;
}
.file-card {
    background: white; border-radius: var(--radius); padding: 2rem; transition: var(--transition);
    box-shadow: var(--shadow); position: relative; overflow: hidden;
}
.file-card::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--primary); opacity: 0; transition: opacity 0.3s ease; z-index: 0;
}
.file-card:hover::before { opacity: 0.05; }
.file-card:hover { transform: translateY(-10px); box-shadow: var(--shadow-lg); }
.file-header { display: flex; align-items: flex-start; gap: 1rem; margin-bottom: 1.5rem; position: relative; z-index: 1; }
.file-icon {
    width: 60px; height: 60px; background: var(--primary); border-radius: 15px;
    display: flex; align-items: center; justify-content: center; font-size: 1.5rem;
    color: white; flex-shrink: 0; transition: var(--transition);
}
.file-card:hover .file-icon { transform: scale(1.1) rotate(15deg); }
.file-info { flex: 1; }
.file-name { font-size: 1.3rem; margin-bottom: 0.5rem; color: var(--dark); }
.file-meta { display: flex; gap: 1rem; font-size: 0.9rem; color: var(--gray); }
.file-description { margin-bottom: 1.5rem; color: var(--gray); line-height: 1.6; position: relative; z-index: 1; }
.file-actions { display: flex; gap: 1rem; position: relative; z-index: 1; }
.action-btn {
    flex: 1; padding: 0.8rem 1.5rem; border: none; border-radius: 10px; font-weight: 600;
    cursor: pointer; transition: var(--transition); display: flex; align-items: center;
    justify-content: center; gap: 8px;
}
.download-btn { background: var(--primary); color: white; border: 2px solid var(--primary); }
.download-btn:hover { background: var(--primary-dark); border-color: var(--primary-dark); transform: translateY(-3px); box-shadow: 0 10px 20px rgba(74,108,247,0.3); }
.preview-btn { background: white; color: var(--primary); border: 2px solid var(--primary); }
.preview-btn:hover { background: var(--primary); color: white; transform: translateY(-3px); }

/* ===== FEATURED SLIDER ===== */
.featured-slider { max-width: 1400px; margin: 0 auto; position: relative; overflow: hidden; }
.slider-container {
    display: flex; gap: 2rem; padding: 1rem; overflow-x: auto; scroll-behavior: smooth;
    scrollbar-width: none;
}
.slider-container::-webkit-scrollbar { display: none; }
.slider-item { min-width: 400px; background: white; border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); transition: var(--transition); }
.slider-item:hover { transform: translateY(-10px); box-shadow: var(--shadow-lg); }
.slider-controls { display: flex; justify-content: center; gap: 1rem; margin-top: 2rem; }
.slider-btn {
    width: 50px; height: 50px; background: white; border: 2px solid var(--primary);
    border-radius: 50%; display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 1.2rem; color: var(--primary); transition: var(--transition);
}
.slider-btn:hover { background: var(--primary); color: white; transform: scale(1.1); }

/* ===== SUBJECT PAGE STYLES ===== */
.subject-container { max-width: 1400px; margin: 100px auto 2rem; padding: 0 2rem; }
.subject-header {
    background: linear-gradient(135deg, rgba(74,108,247,0.1), rgba(108,99,255,0.1));
    border-radius: 20px; padding: 3rem; margin-bottom: 3rem; backdrop-filter: blur(10px);
    border: 2px solid rgba(74,108,247,0.2);
}
.subject-header-content { display: flex; align-items: center; gap: 2rem; flex-wrap: wrap; }
.subject-icon-large {
    width: 100px; height: 100px; border-radius: 25px; display: flex; align-items: center;
    justify-content: center; font-size: 3rem; color: white; flex-shrink: 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
}
.subject-info { flex: 1; }
.subject-title { font-size: 2.8rem; margin-bottom: 1rem; color: var(--dark); }
.subject-description { font-size: 1.2rem; color: var(--gray); margin-bottom: 1.5rem; line-height: 1.6; }
.subject-meta { display: flex; gap: 2rem; flex-wrap: wrap; }
.meta-item {
    display: flex; align-items: center; gap: 0.5rem; color: var(--primary); font-weight: 500;
    background: rgba(74,108,247,0.1); padding: 0.5rem 1rem; border-radius: 10px;
}
.meta-item i { font-size: 1.2rem; }
.subject-files-section { margin-top: 3rem; }

/* ===== ERROR STATES ===== */
.error-state { text-align: center; padding: 5rem 2rem; }
.error-state i { font-size: 5rem; color: var(--danger); margin-bottom: 1.5rem; }
.error-state p { font-size: 1.5rem; color: var(--gray); margin-bottom: 2rem; }
.error-state .btn { margin-top: 1rem; }

/* ===== FOOTER ===== */
.footer { background: #2c3d50; color: #2c3d50; position: relative; padding-top: 5rem; }
.footer-content {
    max-width: 1400px; margin: 0 auto; padding: 0 2rem;
    display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 3rem;
    position: relative; z-index: 1;
}
.footer-section h3 { font-size: 1.5rem; margin-bottom: 1.5rem; color: white; }
.footer-logo { display: flex; align-items: center; gap: 10px; font-size: 1.8rem; font-weight: 700; margin-bottom: 1rem; color: white; }
.footer-description { color: rgba(255,255,255,0.7); margin-bottom: 1.5rem; line-height: 1.6; }
.social-links { display: flex; gap: 1rem; }
.social-link {
    width: 45px; height: 45px; background: var(--primary); border-radius: 50%;
    display: flex; align-items: center; justify-content: center; color: white;
    font-size: 1.2rem; transition: var(--transition);
}
.social-link:hover { background: var(--primary-dark); transform: translateY(-5px); }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 1rem; }
.footer-links a {
    color: rgba(255,255,255,0.7); text-decoration: none; transition: var(--transition);
    display: inline-block;
}
.footer-links a:hover { color: white; transform: translateX(10px); }
.newsletter-form { display: flex; gap: 10px; margin-top: 1rem; }
.newsletter-form input {
    flex: 1; padding: 0.8rem 1.2rem; background: rgba(255,255,255,0.1); border: none;
    border-radius: 10px; color: white; font-family: 'Cairo', sans-serif;
}
.newsletter-form input::placeholder { color: rgba(255,255,255,0.5); }
.newsletter-form button {
    width: 50px; background: var(--primary); border: none; border-radius: 10px;
    color: white; cursor: pointer; transition: var(--transition);
}
.newsletter-form button:hover { background: var(--primary-dark); transform: scale(1.1); }
.footer-bottom {
    text-align: center; padding: 2rem; margin-top: 3rem;
    border-top: 1px solid rgba(255,255,255,0.1); position: relative; z-index: 1;
}
.footer-bottom p { margin-bottom: 0.5rem; color: rgba(255,255,255,0.7); }
.footer-bottom i { color: var(--accent); margin: 0 5px; }
.footer-waves { position: absolute; top: 0; left: 0; width: 100%; height: 150px; overflow: hidden; line-height: 0; }
.footer-waves svg { position: relative; display: block; width: calc(100% + 1.3px); height: 150px; }
.footer-waves path { fill: #2c3d50 }

/* ===== BACK TO TOP ===== */
.back-to-top {
    position: fixed; bottom: 2rem; right: 2rem; width: 50px; height: 50px;
    background: var(--primary); color: white; border: none; border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
    cursor: pointer; opacity: 0; visibility: hidden; transition: var(--transition);
    z-index: 999; box-shadow: var(--shadow);
}
.back-to-top.visible { opacity: 1; visibility: visible; }
.back-to-top:hover { background: var(--primary-dark); transform: translateY(-5px) scale(1.1); box-shadow: 0 15px 30px rgba(74,108,247,0.4); }

/* ===== GPA CALCULATOR STYLES ===== */
.gpa-container { max-width: 1400px; margin: 100px auto 2rem; padding: 0 2rem; }
.gpa-header {
    text-align: center; margin-bottom: 3rem; padding: 3rem;
    background: linear-gradient(135deg, rgba(74,108,247,0.1), rgba(108,99,255,0.1));
    border-radius: var(--radius); backdrop-filter: blur(10px); border: 2px solid var(--border);
}
.gpa-header h1 { font-size: 3.5rem; margin-bottom: 1rem; color: var(--primary); }
.gpa-subtitle { font-size: 1.3rem; color: var(--gray); max-width: 600px; margin: 0 auto; }

/* Grades System */
.grades-system { background: white; border-radius: var(--radius); padding: 2rem; margin-bottom: 2rem; box-shadow: var(--shadow); }
.grades-system h2 { font-size: 1.8rem; margin-bottom: 1.5rem; color: var(--dark); display: flex; align-items: center; gap: 10px; }
.grades-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 1rem; }
.grade-card {
    background: white; border: 2px solid var(--border); border-radius: 10px; padding: 1.5rem 1rem;
    text-align: center; transition: var(--transition); cursor: pointer; position: relative; overflow: hidden;
}
.grade-card::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 5px;
    background: var(--primary); transform: scaleX(0); transition: transform 0.3s ease;
}
.grade-card:hover::before { transform: scaleX(1); }
.grade-card.selected { border-color: var(--primary); box-shadow: 0 5px 15px rgba(74,108,247,0.2); transform: translateY(-3px); }
.grade-card.a-plus { border-top-color: #27AE60; }
.grade-card.a { border-top-color: #2ECC71; }
.grade-card.a-minus { border-top-color: #3498DB; }
.grade-card.b-plus { border-top-color: #9B59B6; }
.grade-card.b { border-top-color: #34495E; }
.grade-card.b-minus { border-top-color: #F39C12; }
.grade-card.c-plus { border-top-color: #E67E22; }
.grade-card.c { border-top-color: #D35400; }
.grade-card.c-minus { border-top-color: #E74C3C; }
.grade-card.d-plus { border-top-color: #C0392B; }
.grade-card.d { border-top-color: #7F8C8D; }
.grade-card.d-minus { border-top-color: #95A5A6; }
.grade-card.f { border-top-color: #BDC3C7; }
.grade { display: block; font-size: 1.8rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--dark); }
.points { display: block; font-size: 1.2rem; color: var(--primary); font-weight: 600; }

/* Previous GPA Section */
.previous-gpa-section {
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(255,255,255,0.05) 100%);
    border-radius: 16px; padding: 24px; margin-bottom: 32px;
    border: 1px solid rgba(74,108,247,0.1); box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    backdrop-filter: blur(10px);
}
.previous-gpa-section .section-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px;
    padding-bottom: 16px; border-bottom: 1px solid rgba(74,108,247,0.1);
}
.previous-gpa-section h2 {
    color: var(--text-color); margin: 0; font-size: 1.3rem; font-weight: 600;
    display: flex; align-items: center; gap: 10px;
}
.previous-gpa-section h2 i { color: #6C63FF; background: rgba(108,99,255,0.1); padding: 10px; border-radius: 12px; }
.toggle-switch-container { display: flex; align-items: center; gap: 12px; }
.toggle-switch { position: relative; display: inline-block; width: 56px; height: 28px; }
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
    position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, #E0E0E0 0%, #B0B0B0 100%);
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55); border-radius: 34px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}
.toggle-slider:before {
    position: absolute; content: ""; height: 20px; width: 20px; left: 4px; bottom: 4px;
    background: white; transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-radius: 50%; box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}
input:checked + .toggle-slider { background: linear-gradient(90deg, #4A6CF7 0%, #6C63FF 100%); }
input:checked + .toggle-slider:before { transform: translateX(28px); box-shadow: 0 2px 4px rgba(74,108,247,0.3); }
.toggle-label { color: var(--text-secondary); font-size: 0.9rem; font-weight: 500; transition: color 0.3s; }
input:checked ~ .toggle-label { color: var(--primary); }
.previous-inputs-container { display: none; animation: fadeInUp 0.5s ease; }
.previous-inputs-container.show { display: block; }
@keyframes fadeInUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
.prev-input-row {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 24px; margin-bottom: 20px;
}
.prev-input-group { margin-bottom: 0; }
.prev-input-group label {
    display: block; margin-bottom: 10px; color: var(--text-color); font-weight: 500;
    font-size: 0.95rem; display: flex; align-items: center; gap: 8px;
}
.prev-input-group label i { color: #6C63FF; font-size: 1.1rem; }
.prev-input-wrapper { position: relative; display: flex; align-items: center; }
.prev-input-field {
    width: 100%; padding: 14px 16px; padding-right: 70px;
    border: 2px solid rgba(74,108,247,0.2); border-radius: 12px;
    background: rgba(255,255,255,0.05); color: var(--text-color); font-size: 1rem;
    font-weight: 500; transition: all 0.3s ease; box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.prev-input-field:focus {
    outline: none; border-color: #6C63FF; box-shadow: 0 0 0 4px rgba(108,99,255,0.15);
    background: rgba(255,255,255,0.08);
}
.prev-input-field::placeholder { color: var(--text-tertiary); opacity: 0.7; }
.prev-input-suffix { position: absolute; right: 16px; color: var(--text-secondary); font-size: 0.9rem; font-weight: 500; pointer-events: none; }
.prev-info-box {
    background: linear-gradient(135deg, rgba(74,108,247,0.08) 0%, rgba(108,99,255,0.08) 100%);
    border: 1px solid rgba(108,99,255,0.15); border-radius: 12px; padding: 18px;
    display: flex; align-items: flex-start; gap: 16px; animation: fadeIn 0.6s ease;
}
.prev-info-icon { background: linear-gradient(135deg, #4A6CF7, #6C63FF); color: white; width: 40px; height: 40px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; flex-shrink: 0; }
.prev-info-content { flex: 1; }
.prev-info-title { color: var(--text-color); font-weight: 600; margin-bottom: 6px; font-size: 1rem; }
.prev-info-desc { color: var(--text-secondary); font-size: 0.9rem; line-height: 1.5; margin: 0; }

/* Calculator Section */
.calculator-section { background: white; border-radius: var(--radius); padding: 2rem; margin-bottom: 2rem; box-shadow: var(--shadow); }
.calculator-section .section-header {
    display: flex; justify-content: space-between; align-items: center; margin-bottom: 2rem;
    padding-bottom: 1.5rem; border-bottom: 2px solid #f0f0f0;
}
.calculator-section .section-header h2 { font-size: 1.8rem; color: var(--dark); display: flex; align-items: center; gap: 10px; }

/* Courses List */
.courses-list { margin-bottom: 2rem; }
.course-item {
    background: white; border: 2px solid var(--border); border-radius: 12px; padding: 1.5rem;
    margin-bottom: 1rem; display: grid; grid-template-columns: 2fr 1fr 1.5fr auto;
    gap: 1rem; align-items: center; transition: var(--transition);
}
.course-item:hover { border-color: var(--primary); box-shadow: var(--shadow); }
.course-item input, .course-item select {
    padding: 0.8rem 1rem; border: 2px solid var(--border); border-radius: 8px;
    font-size: 1rem; font-family: 'Cairo', sans-serif; transition: var(--transition);
    background: white;
}
.course-item input:focus, .course-item select:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(74,108,247,0.1);
}
.course-name { font-weight: 600; }
.remove-course {
    width: 40px; height: 40px; background: var(--danger); color: white; border: none;
    border-radius: 50%; cursor: pointer; transition: var(--transition);
    display: flex; align-items: center; justify-content: center;
}
.remove-course:hover { background: #C0392B; transform: scale(1.1); }

.calculator-actions { display: flex; gap: 1rem; justify-content: center; padding-top: 2rem; border-top: 2px solid #f0f0f0; }

/* Results Section */
.results-section {
    background: linear-gradient(135deg, #f8faff 0%, #f0f4ff 100%); border-radius: var(--radius);
    padding: 2rem; margin-bottom: 2rem; box-shadow: var(--shadow); border: 2px solid var(--border);
    opacity: 0; transform: translateY(20px); transition: opacity 0.5s ease, transform 0.5s ease;
}
.results-section.show { opacity: 1; transform: translateY(0); }
.results-section h2 { font-size: 1.8rem; margin-bottom: 1.5rem; color: var(--dark); display: flex; align-items: center; gap: 10px; }
.results-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.result-card { background: white; border: 2px solid var(--border); border-radius: 12px; padding: 1.5rem; text-align: center; transition: var(--transition); }
.result-card:hover { border-color: var(--primary); transform: translateY(-5px); box-shadow: var(--shadow); }
.result-icon { width: 60px; height: 60px; background: var(--primary); border-radius: 12px; display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem; font-size: 1.5rem; color: white; }
.result-content h3 { font-size: 1rem; color: var(--gray); margin-bottom: 0.5rem; }
.result-value { font-size: 2.5rem; font-weight: 800; color: var(--primary); margin: 0.5rem 0; }

/* GPA Chart */
.gpa-chart { margin-top: 2rem; }
.chart-container {
    display: flex; align-items: flex-end; justify-content: center; height: 200px;
    gap: 2rem; padding: 2rem; background: white; border-radius: 12px;
    border: 2px solid var(--border);
}
.chart-bar { width: 40px; background: var(--primary); border-radius: 8px 8px 0 0; position: relative; transition: height 1s ease; }
.chart-value { position: absolute; top: -25px; left: 50%; transform: translateX(-50%); font-weight: 600; color: var(--primary); }
.chart-scale { display: flex; justify-content: space-between; padding: 1rem; color: var(--gray); font-size: 0.9rem; }

/* Help Section */
.help-section { background: white; border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); }
.help-section h2 { font-size: 1.8rem; margin-bottom: 1.5rem; color: var(--dark); display: flex; align-items: center; gap: 10px; }
.help-content { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 1.5rem; }
.help-item { background: white; border: 2px solid var(--border); border-radius: 12px; padding: 1.5rem; transition: var(--transition); }
.help-item:hover { border-color: var(--primary); transform: translateY(-3px); }
.help-icon { width: 50px; height: 50px; background: var(--primary); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; color: white; flex-shrink: 0; }
.help-text h3 { font-size: 1.2rem; margin-bottom: 0.5rem; color: var(--dark); }
.help-text p { color: var(--gray); line-height: 1.6; }

/* ===== ADMIN PANEL STYLES ===== */
.admin-body { font-family: 'Cairo', sans-serif; background: var(--primary); min-height: 100vh; margin: 0; color: #333; }

/* Login Container */
.login-container { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.login-card {
    background: rgba(255,255,255,0.95); backdrop-filter: blur(10px); border-radius: 25px;
    padding: 3rem 2.5rem; width: 100%; max-width: 450px; box-shadow: 0 25px 50px rgba(0,0,0,0.2);
    text-align: center;
}
.login-header { margin-bottom: 2rem; }
.login-logo {
    width: 80px; height: 80px; background: var(--primary); border-radius: 20px;
    display: flex; align-items: center; justify-content: center; margin: 0 auto 1.5rem;
    font-size: 2rem; color: white;
}
.login-header h2 { color: #333; margin-bottom: 0.5rem; font-size: 1.8rem; }
.login-header p { color: #666; font-size: 1rem; }
.login-form { display: flex; flex-direction: column; gap: 1.5rem; }
.form-group { text-align: right; position: relative; }
.form-group label { display: flex; align-items: center; gap: 0.5rem; color: #555; margin-bottom: 0.5rem; font-weight: 500; font-size: 0.95rem; }
.form-group input {
    width: 100%; padding: 1rem 1.2rem; padding-left: 3rem; border: 2px solid #e0e0e0;
    border-radius: 12px; font-size: 1rem; transition: all 0.3s ease; background: #f8f9ff;
    font-family: 'Cairo', sans-serif;
}
.form-group input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(74,108,247,0.1); }
.show-password {
    position: absolute; left: 1rem; top: 50%; transform: translateY(-50%);
    background: none; border: none; color: #666; cursor: pointer; font-size: 1.1rem;
    transition: color 0.3s ease;
}
.show-password:hover { color: var(--primary); }
.login-btn { margin-top: 1rem; padding: 1rem 2rem; font-size: 1.1rem; }
.login-footer { margin-top: 2rem; padding-top: 1.5rem; border-top: 1px solid #eee; }
.login-footer p { color: #666; font-size: 0.9rem; }

/* Dashboard */
.dashboard-container { min-height: 100vh; background: #f5f7ff; }
.dashboard-header {
    background: white; padding: 1rem 2rem; box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    display: flex; justify-content: space-between; align-items: center; position: fixed;
    top: 0; width: 100%; z-index: 1000;
}
.dashboard-logo { display: flex; align-items: center; gap: 10px; font-size: 1.5rem; font-weight: 700; color: var(--primary); text-decoration: none; }
.dashboard-logo i { font-size: 1.8rem; }
.dashboard-actions { display: flex; align-items: center; gap: 1.5rem; }
.user-info { display: flex; align-items: center; gap: 0.8rem; color: #555; }
.user-avatar { width: 40px; height: 40px; background: var(--primary); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-size: 1.2rem; }
.logout-btn { background: var(--danger); color: white; border: none; padding: 0.6rem 1.5rem; border-radius: 8px; cursor: pointer; font-weight: 500; transition: all 0.3s ease; display: flex; align-items: center; gap: 0.5rem; }
.logout-btn:hover { background: #C0392B; transform: translateY(-2px); box-shadow: 0 5px 15px rgba(231,76,60,0.3); }
.dashboard-content { margin-top: 70px; padding: 2rem; }
.dashboard-grid { display: grid; grid-template-columns: 250px 1fr; gap: 2rem; max-width: 1400px; margin: 0 auto; }

/* Sidebar */
.dashboard-sidebar {
    background: white; border-radius: 20px; padding: 1.5rem; box-shadow: 0 10px 30px rgba(0,0,0,0.05);
    height: fit-content; position: sticky; top: 90px;
}
.sidebar-menu { list-style: none; padding: 0; }
.sidebar-item { margin-bottom: 0.5rem; }
.sidebar-link {
    display: flex; align-items: center; gap: 0.8rem; padding: 1rem 1.2rem; color: #555;
    text-decoration: none; border-radius: 12px; transition: all 0.3s ease; font-weight: 500;
}
.sidebar-link:hover, .sidebar-link.active { background: var(--primary); color: white; transform: translateX(-5px); }
.sidebar-link i { font-size: 1.2rem; width: 24px; text-align: center; }

/* Main Content */
.dashboard-main { background: white; border-radius: 20px; padding: 2rem; box-shadow: 0 10px 30px rgba(0,0,0,0.05); }
.dashboard-title { font-size: 1.8rem; margin-bottom: 1.5rem; color: #333; display: flex; align-items: center; gap: 0.8rem; }

/* Admin Stats Cards */
.admin-stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; margin-bottom: 2rem; }
.admin-stat-card {
    background: white; border: 2px solid var(--border); border-radius: 15px; padding: 1.5rem;
    text-align: center; transition: all 0.3s ease;
}
.admin-stat-card:hover { transform: translateY(-5px); border-color: var(--primary); box-shadow: 0 15px 40px rgba(74,108,247,0.15); }
.admin-stat-icon { width: 60px; height: 60px; background: var(--primary); border-radius: 15px; display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem; font-size: 1.5rem; color: white; transition: all 0.3s ease; }
.admin-stat-card:hover .admin-stat-icon { transform: scale(1.1) rotate(360deg); }
.admin-stat-number { font-size: 2.5rem; font-weight: 700; margin-bottom: 0.5rem; color: var(--primary); }
.admin-stat-label { color: #666; font-size: 0.9rem; }

/* Admin Forms */
.admin-form { display: grid; gap: 1.5rem; margin-top: 1.5rem; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.5rem; }
.form-group-full { grid-column: 1 / -1; }
.form-group label { display: block; margin-bottom: 0.5rem; color: #555; font-weight: 500; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 0.8rem 1rem; border: 2px solid var(--border); border-radius: 10px;
    font-size: 1rem; font-family: 'Cairo', sans-serif; transition: all 0.3s ease; background: white;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
    outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(74,108,247,0.1);
}
.checkbox-group { display: flex; align-items: center; gap: 0.5rem; }
.checkbox-label { display: flex; align-items: center; gap: 0.5rem; cursor: pointer; user-select: none; }
.checkbox-label input[type="checkbox"] { width: auto; }

/* Upload Area */
.upload-area {
    border: 3px dashed #ddd; border-radius: 15px; padding: 3rem; text-align: center;
    cursor: pointer; transition: all 0.3s ease; background: #f8f9ff; margin-top: 1rem;
}
.upload-area:hover { border-color: var(--primary); background: #f0f2ff; }
.upload-area i { font-size: 3rem; color: var(--primary); margin-bottom: 1rem; }
.upload-area p { color: #666; margin-bottom: 0.5rem; }
.upload-area small { color: #999; font-size: 0.9rem; }

/* Tables */
.table-responsive { overflow-x: auto; margin: 1.5rem 0; border-radius: 12px; border: 1px solid var(--border); }
.admin-table { width: 100%; border-collapse: collapse; background: white; min-width: 800px; }
.admin-table th { background: var(--primary); padding: 1rem; text-align: right; font-weight: 600; color: white; white-space: nowrap; }
.admin-table td { padding: 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr:hover { background: rgba(74,108,247,0.05); }

/* Action Buttons */
.action-buttons { display: flex; gap: 0.5rem; justify-content: flex-start; flex-wrap: wrap; }
.btn-icon {
    width: 36px; height: 36px; border-radius: 8px; border: none; display: inline-flex;
    align-items: center; justify-content: center; cursor: pointer; transition: all 0.2s ease;
    background: transparent; color: var(--gray);
}
.btn-icon:hover { transform: translateY(-2px); }
.btn-edit { background: rgba(74,108,247,0.1); color: var(--primary); }
.btn-edit:hover { background: var(--primary); color: white; }
.btn-delete { background: rgba(231,76,60,0.1); color: var(--danger); }
.btn-delete:hover { background: var(--danger); color: white; }
.btn-view { background: rgba(46,204,113,0.1); color: var(--success); }
.btn-view:hover { background: var(--success); color: white; }

/* Admin Subject Cards */
.subjects-grid-admin {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 1.5rem; margin-top: 1.5rem;
}
.admin-subject-card {
    background: white; border-radius: 16px; padding: 1.5rem; box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: all 0.3s ease; border: 1px solid var(--border); display: flex; flex-direction: column; gap: 1rem;
}
.admin-subject-card:hover { transform: translateY(-5px); box-shadow: 0 10px 30px rgba(74,108,247,0.15); }
.admin-subject-card .subject-header { display: flex; align-items: center; gap: 1rem; }
.admin-subject-card .subject-icon {
    width: 60px; height: 60px; border-radius: 16px; display: flex; align-items: center;
    justify-content: center; font-size: 1.8rem; color: white; flex-shrink: 0;
}
.admin-subject-card .subject-info { flex: 1; }
.admin-subject-card .subject-name { margin: 0 0 0.3rem; font-size: 1.3rem; color: var(--dark); }
.admin-subject-card .subject-type { margin: 0; color: var(--gray); font-size: 0.9rem; display: flex; align-items: center; gap: 0.4rem; }
.subject-stats { display: flex; gap: 1.5rem; padding: 1rem 0; border-top: 1px dashed var(--border); border-bottom: 1px dashed var(--border); }
.subject-stats .stat-item { display: flex; align-items: center; gap: 0.5rem; color: var(--gray); font-size: 0.9rem; }
.subject-stats .stat-item i { color: var(--primary); }
.subject-description { color: var(--gray); line-height: 1.6; margin: 0; font-size: 0.95rem; }
.subject-footer { display: flex; justify-content: flex-end; padding-top: 0.5rem; }
.subject-actions { display: flex; gap: 0.5rem; }

/* Tabs */
.admin-tabs { display: flex; gap: 0.5rem; margin-bottom: 2rem; border-bottom: 2px solid #eee; padding-bottom: 0.5rem; flex-wrap: wrap; }
.admin-tab {
    padding: 0.8rem 1.5rem; background: #f8f9ff; border: none; border-radius: 10px 10px 0 0;
    cursor: pointer; transition: all 0.3s ease; font-weight: 500; color: #555;
}
.admin-tab:hover { background: #eef1ff; }
.admin-tab.active { background: var(--primary); color: white; }
.tab-content { display: none; animation: fadeIn 0.5s ease; }
.tab-content.active { display: block; }

/* Empty / Error / Loading States */
.empty-state { text-align: center; padding: 3rem; color: #666; }
.empty-state i { font-size: 4rem; margin-bottom: 1rem; opacity: 0.3; }
.empty-state p { font-size: 1.1rem; }
.loading-state { text-align: center; padding: 3rem; }
.loading-state .loader { width: 50px; height: 50px; border: 4px solid #f3f3f3; border-top: 4px solid var(--primary); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 1rem; }
.error-state { text-align: center; padding: 3rem; color: var(--danger); }
.error-state i { font-size: 4rem; margin-bottom: 1rem; }
.error-state p { font-size: 1.1rem; }

/* Notifications */
.notification {
    position: fixed; top: 20px; right: 20px; background: white; border-radius: 10px;
    padding: 1rem 1.5rem; display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; box-shadow: 0 10px 30px rgba(0,0,0,0.2); z-index: 10000;
    transform: translateX(100%); opacity: 0; transition: transform 0.3s ease, opacity 0.3s ease;
    min-width: 300px; max-width: 400px;
}
.notification.show { transform: translateX(0); opacity: 1; }
.notification-success { border-right: 4px solid var(--success); }
.notification-error { border-right: 4px solid var(--danger); }
.notification-info { border-right: 4px solid var(--primary); }
.notification-content { display: flex; align-items: center; gap: 0.8rem; flex: 1; }
.notification-content i { font-size: 1.2rem; }
.notification-success .notification-content i { color: var(--success); }
.notification-error .notification-content i { color: var(--danger); }
.notification-info .notification-content i { color: var(--primary); }
.notification-close { background: none; border: none; font-size: 1.5rem; color: #999; cursor: pointer; padding: 0; line-height: 1; }
.notification-close:hover { color: #333; }

/* Charts */
.charts-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); gap: 2rem; margin-top: 2rem; }
.chart-card { background: #f8f9ff; border-radius: 15px; padding: 1.5rem; }
.chart-card h3 { margin: 0 0 1rem; color: #333; font-size: 1.2rem; }
.chart-item { margin-bottom: 1rem; display: flex; align-items: center; gap: 1rem; }
.chart-label { width: 100px; color: #666; font-size: 0.9rem; }
.chart-bar { flex: 1; height: 30px; background: var(--primary); border-radius: 6px; position: relative; transition: width 1s ease; }
.bar-value { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); color: white; font-weight: 600; font-size: 0.9rem; }

/* Quick Actions */
.actions-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; margin-top: 1rem; }

/* Activity List */
.activity-list { display: flex; flex-direction: column; gap: 1rem; }
.activity-item { display: flex; align-items: center; gap: 1rem; padding: 1rem; background: #f8f9ff; border-radius: 10px; transition: all 0.3s ease; }
.activity-item:hover { background: #eef1ff; transform: translateX(-5px); }
.activity-icon { width: 40px; height: 40px; background: var(--primary); border-radius: 10px; display: flex; align-items: center; justify-content: center; color: white; font-size: 1.2rem; flex-shrink: 0; }
.activity-content p { margin: 0 0 0.3rem; color: #333; font-weight: 500; }
.activity-content small { color: #666; font-size: 0.9rem; }

/* Modal Styles */
.custom-modal {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 9999;
    display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.modal-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.5); backdrop-filter: blur(5px); }
.modal-container {
    background: white; border-radius: 20px; width: 100%; max-width: 600px; max-height: 80vh;
    overflow-y: auto; z-index: 1; box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}
.modal-header { padding: 1.5rem; border-bottom: 1px solid #eee; display: flex; justify-content: space-between; align-items: center; }
.modal-header h2 { margin: 0; color: var(--dark); }
.modal-close { background: none; border: none; font-size: 2rem; color: var(--gray); cursor: pointer; transition: var(--transition); }
.modal-close:hover { color: var(--danger); transform: rotate(90deg); }
.modal-body { padding: 1.5rem; }
.loading-modal { padding: 3rem; text-align: center; }
.loading-modal .loader { width: 60px; height: 60px; border: 4px solid #f3f3f3; border-top: 4px solid var(--primary); border-radius: 50%; animation: spin 1s linear infinite; margin: 0 auto 1rem; }
.error-modal { padding: 2rem; text-align: center; }
.error-icon { width: 80px; height: 80px; background: var(--danger); border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 1.5rem; font-size: 2.5rem; color: white; }

/* File Items */
.files-list { display: flex; flex-direction: column; gap: 1rem; }
.file-item {
    display: flex; align-items: center; gap: 1rem; padding: 1rem; background: #f8f9fa;
    border-radius: 10px; transition: var(--transition);
}
.file-item:hover { background: #e9ecef; transform: translateX(-5px); }
.file-item .file-icon { width: 40px; height: 40px; background: var(--primary); border-radius: 10px; display: flex; align-items: center; justify-content: center; color: white; }
.file-item .file-info { flex: 1; }
.file-item .file-info h4 { margin: 0 0 0.3rem; color: var(--dark); }
.file-item .file-info p { margin: 0; color: var(--gray); font-size: 0.9rem; }
.file-item .file-info small { color: var(--gray); font-size: 0.8rem; }

/* Congratulations Toast */
.congratulation-toast {
    position: fixed; top: 20px; right: 20px; background: var(--success); color: white;
    padding: 1.5rem; border-radius: 15px; display: flex; align-items: center; gap: 1.5rem;
    z-index: 10000; transform: translateX(100%); opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    box-shadow: 0 10px 30px rgba(46,204,113,0.3); max-width: 400px;
}
.congratulation-toast.show { transform: translateX(0); opacity: 1; }
.toast-icon { font-size: 2.5rem; }
.toast-content h3 { margin: 0 0 0.5rem; font-size: 1.3rem; }
.toast-content p { margin: 0; font-size: 1rem; opacity: 0.9; }

/* File Type Badge */
.file-type-badge { display: inline-block; padding: 0.3rem 0.8rem; background: #e3f2fd; color: #1976d2; border-radius: 20px; font-size: 0.8rem; font-weight: 500; text-transform: uppercase; }
.status-badge { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.4rem 0.8rem; border-radius: 20px; font-size: 0.9rem; font-weight: 500; }
.status-badge.featured { background: #e8f5e9; color: #2e7d32; }
.status-badge i { font-size: 0.8rem; }
.subject-badge { background: rgba(74,108,247,0.1); color: var(--primary); padding: 0.4rem 0.8rem; border-radius: 20px; font-size: 0.9rem; font-weight: 500; display: inline-block; }
.date-text { color: var(--gray); font-size: 0.9rem; }

/* ===== DARK THEME ===== */
.dark-theme {
    --primary: #6A8BFF;
    --primary-dark: #5A7BEE;
    --secondary: #8C63FF;
    --accent: #FF8BA3;
    --success: #3EDC81;
    --warning: #FFAC2C;
    --danger: #FF5C4C;
    --dark: #F8F9FA;
    --darkq: #2c3d50;

    --light: #1A1A2E;
    --lightq: #2c3d50;

    --gray: #BDC3C7;
    --border: #2D3748;
}
.dark-theme .navbar { background: rgba(26,26,46,0.95); }
.dark-theme .file-card, .dark-theme .subject-card, .dark-theme .feature-card,
.dark-theme .dropdown-menu, .dark-theme .university-subject-item,
.dark-theme .subject-container .subject-header, .dark-theme .subject-container .subject-files-section,
.dark-theme .calculator-section, .dark-theme .grades-system, .dark-theme .results-section,
.dark-theme .help-section, .dark-theme .previous-gpa-section, .dark-theme .login-card,
.dark-theme .dashboard-sidebar, .dark-theme .dashboard-main, .dark-theme .admin-stat-card,
.dark-theme .chart-card, .dark-theme .activity-item, .dark-theme .upload-area,
.dark-theme .admin-table, .dark-theme .admin-subject-card {
    background: #2D3748; color: #f8f9fa;
}
.dark-theme .subject-card .subject-name, .dark-theme .feature-card h3,
.dark-theme .dashboard-title, .dark-theme .chart-card h3, .dark-theme .subject-title,
.dark-theme .calculator-section h2, .dark-theme .grades-system h2,
.dark-theme .results-section h2, .dark-theme .help-section h2 { color: #f8f9fa; }
.dark-theme .subject-card .subject-description, .dark-theme .feature-card p,
.dark-theme .file-description, .dark-theme .subject-description,
.dark-theme .help-text p { color: #BDC3C7; }
.dark-theme .file-item, .dark-theme .course-item, .dark-theme .result-card { background: #4a5568; }
.dark-theme .admin-table th { background: var(--primary); }
.dark-theme .admin-table td { color: #f8f9fa; border-color: #4a5568; }
.dark-theme .sidebar-link { color: #f8f9fa; }
.dark-theme .form-group label { color: #f8f9fa; }
.dark-theme .form-group input, .dark-theme .form-group select, .dark-theme .form-group textarea {
    background: #4a5568; border-color: #4a5568; color: #f8f9fa;
}
.dark-theme .form-group input:focus, .dark-theme .form-group select:focus, .dark-theme .form-group textarea:focus {
    border-color: var(--primary);
}
.dark-theme .upload-area { border-color: #4a5568; }
.dark-theme .upload-area:hover { border-color: var(--primary); }
.dark-theme .prev-input-field { background: rgba(255,255,255,0.03); border-color: rgba(108,99,255,0.25); }
.dark-theme .prev-input-field:focus { background: rgba(255,255,255,0.05); }
.dark-theme .prev-info-box {
    background: linear-gradient(135deg, rgba(74,108,247,0.1) 0%, rgba(108,99,255,0.1) 100%);
    border-color: rgba(108,99,255,0.2);
}
.dark-theme .prev-info-title, .dark-theme .prev-info-desc { color: #f8f9fa; }

/* ===== RESPONSIVE MEDIA QUERIES ===== */
@media (max-width: 1024px) {
    .hero-content { grid-template-columns: 1fr; text-align: center; gap: 3rem; }
    .hero-text { text-align: center; }
    .hero-title { font-size: 2.8rem; }
    .section-title { font-size: 2.2rem; }
    .dashboard-grid { grid-template-columns: 1fr; }
    .dashboard-sidebar { position: static; margin-bottom: 2rem; }
    .charts-container { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    /* القائمة العلوية */
    .nav-menu {
        position: fixed; top: 80px; left: -100%; width: 100%; height: calc(100vh - 80px);
        background: var(--light); flex-direction: column; padding: 2rem;
        box-shadow: var(--shadow); transition: left 0.3s ease; overflow-y: auto;
        z-index: 999;
    }
    .nav-menu.active { left: 0; }
    .nav-menu .nav-link {
        width: 100%; justify-content: center; padding: 1rem;
        border-bottom: 1px solid var(--border);
    }
    .nav-dropdown { width: 100%; }
    .nav-dropdown .dropdown-toggle { width: 100%; justify-content: center; }
    .nav-dropdown .dropdown-menu {
        position: static; opacity: 1; visibility: visible; transform: none;
        box-shadow: none; border: none; background: transparent; padding-right: 1rem;
        display: none; width: 100%;
    }
    .nav-dropdown .dropdown-menu.show { display: block; }
    .nav-dropdown .dropdown-menu .university-subject-item {
        background: rgba(255,255,255,0.1); margin: 0.5rem 0; border-radius: 8px;
    }
    .dark-theme .nav-dropdown .dropdown-menu .university-subject-item {
        background: rgba(0,0,0,0.2);
    }
    .menu-toggle { display: flex; }

    /* Hero */
    .hero-title { font-size: 2.2rem; }
    .hero-subtitle { font-size: 1.1rem; }
    .hero-buttons { flex-direction: column; align-items: center; }
    .btn { width: 100%; max-width: 300px; justify-content: center; }

    /* Grids */
    .subjects-grid, .files-grid, .features-grid, .university-categories,
    .subjects-grid-admin, .grades-grid, .results-grid, .help-content {
        grid-template-columns: 1fr;
    }
    .slider-item { min-width: 300px; }

    /* Sections */
    section { padding: 3rem 1rem; }
    .stats-container { grid-template-columns: repeat(2, 1fr); }

    /* Course item (GPA) */
    .course-item { grid-template-columns: 1fr; gap: 1rem; }
    .calculator-actions { flex-direction: column; }

    /* Dashboard */
    .dashboard-content { padding: 1rem; }
    .dashboard-header { padding: 1rem; }
    .dashboard-actions { gap: 1rem; }
    .user-info span { display: none; }
    .admin-stats-grid { grid-template-columns: repeat(2, 1fr); }
    .admin-tabs { flex-wrap: wrap; }
    .admin-tab { flex: 1; min-width: 120px; text-align: center; }

    /* Chart */
    .chart-container { flex-direction: column; height: auto; align-items: center; }
    .chart-bar { width: 80%; height: 40px !important; border-radius: 8px; margin-bottom: 2rem; }
    .chart-value { top: 50%; left: 10px; transform: translateY(-50%); }
    .chart-scale { flex-direction: column; align-items: center; gap: 0.5rem; }

    /* Subject header */
    .subject-header-content { flex-direction: column; text-align: center; }
    .subject-title { font-size: 2rem; }
    .subject-meta { justify-content: center; }
    .subject-icon-large { width: 80px; height: 80px; font-size: 2.5rem; }

    /* Previous GPA */
    .previous-gpa-section { padding: 20px; }
    .previous-gpa-section .section-header { flex-direction: column; align-items: flex-start; gap: 15px; }
    .prev-input-row { grid-template-columns: 1fr; gap: 20px; }
    .prev-info-box { flex-direction: column; text-align: center; }
    .prev-info-icon { margin: 0 auto; }

    /* Study Planner */
    .subject-item { grid-template-columns: 1fr; gap: 1rem; }
    .remove-subject-btn { width: 100%; }
    .calendar-header { flex-direction: column; align-items: flex-start; }
    .planner-title { font-size: 2rem; }
    .planner-steps { grid-template-columns: 1fr 1fr; }

    /* Marks Calculator */
    .component-item { grid-template-columns: 1fr; }
    .component-item .remove-component { width: 100%; }
    .bonus-section { flex-direction: column; align-items: flex-start; }
    .actions { flex-direction: column; }
    .btn-add, .btn-save, .btn-reset, .btn-party { width: 100%; justify-content: center; }

    /* Schedule Page */
    .lecture-item { grid-template-columns: 1fr; }
    .lecture-item .remove-lecture { width: 100%; }
}

@media (max-width: 480px) {
    .nav-container { padding: 1rem; }
    .logo-text { display: none; }
    .hero-title { font-size: 1.8rem; }
    .hero-subtitle { font-size: 1rem; }
    .section-title { font-size: 1.8rem; }
    .stats-container { grid-template-columns: 1fr; }
    .footer-content { grid-template-columns: 1fr; }
    .gpa-header h1 { font-size: 2rem; }
    .calculator-section .section-header { flex-direction: column; gap: 1rem; text-align: center; }
    .results-section, .calculator-section, .grades-system, .help-section { padding: 1.5rem; }
    .login-card { padding: 2rem 1.5rem; }
    .admin-stats-grid { grid-template-columns: 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .action-buttons { flex-direction: column; }
    .btn-icon { width: 100%; }
    .notification { min-width: auto; width: calc(100% - 40px); }
    .planner-steps { grid-template-columns: 1fr; }
    .planner-title { font-size: 1.8rem; }
}
.btn-success {
    background: #2ECC71;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
}
.btn-success:hover {
    background: #27AE60;
}
.btn-danger {
    background: #E74C3C;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.3s;
}
.btn-danger:hover {
    background: #C0392B;
}
.tool-section.difficulty .tool-icon-large {
    background: linear-gradient(145deg, #9B59B6, #8E44AD);
}
.tool-section.difficulty .tool-feature {
    background: rgba(155,89,182,0.15);
    color: #9B59B6;
}