:root {
    --primary-color: #2c3e50;
    --secondary-color: #e67e22;
    --accent-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #f1c40f;
    --danger-color: #c0392b;
    --light-bg: #f8f9fa;
    --white: #ffffff;
    --sidebar-gradient: linear-gradient(180deg, #ffffff 0%, #f4f6f7 100%);
    --radius: 12px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light-bg);
    color: var(--primary-color);
    direction: rtl;
    line-height: 1.6;
    height: 100vh;
    overflow: hidden;
}

html {
    height: 100%;
    overflow: hidden;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

.app-container {
    display: flex;
    height: 100vh;
    /* Fixed height to viewport */
    overflow: hidden;
    /* Prevent body scroll */
}

/* ═══════════════════════════════════════════════════════════ */
/* ▌  SIDEBAR - تصميم عصري مع زخارف مدرسية                  ▌ */
/* ═══════════════════════════════════════════════════════════ */
.sidebar {
    width: 280px;
    background: linear-gradient(180deg, #0a1628 0%, #12264a 30%, #1a3568 60%, #234785 100%);
    padding: 0;
    position: fixed;
    top: 0;
    right: 0;
    height: 100vh;
    overflow-y: auto;
    box-shadow: -6px 0 30px rgba(0, 0, 0, 0.35);
    z-index: 1000;
    border-left: 2px solid rgba(255, 255, 255, 0.12);
    color: white;
    display: flex;
    flex-direction: column;
}

.sidebar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image:
        radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.04) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(52, 152, 219, 0.06) 0%, transparent 50%);
    pointer-events: none;
    z-index: 0;
}

.sidebar::-webkit-scrollbar {
    width: 5px;
}

.sidebar::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.15);
}

.sidebar::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0.2) 100%);
    border-radius: 10px;
}

.sidebar::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.7);
}

/* Logo Container - تصميم جديد */
.logo-container {
    text-align: center;
    padding: 1.6rem 1rem 1.2rem;
    position: relative;
    z-index: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.2) 0%, transparent 100%);
}

.school-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.15) 0%, rgba(255, 255, 255, 0.05) 100%);
    color: #fff;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 0.6rem;
    font-size: 2rem;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    border: 2px solid rgba(255, 255, 255, 0.18);
    animation: glow-icon 4s ease-in-out infinite;
    backdrop-filter: blur(4px);
}

@keyframes glow-icon {

    0%,
    100% {
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3), 0 0 0 0 rgba(255, 255, 255, 0);
    }

    50% {
        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3), 0 0 18px 4px rgba(255, 255, 255, 0.08);
    }
}

.logo-container h2 {
    font-family: 'Amiri', serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.4rem;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    letter-spacing: 0.5px;
    line-height: 1.5;
}

.term-badge {
    background: rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.9);
    padding: 4px 16px;
    border-radius: 20px;
    font-size: 0.78rem;
    display: inline-block;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.15);
    letter-spacing: 0.5px;
}

/* Sidebar Bottom Decoration - زخرفة القمر */
.sidebar-decoration {
    margin-top: auto;
    padding: 1.5rem 1rem;
    text-align: center;
    position: relative;
    z-index: 1;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-decoration .moon-icon {
    font-size: 2.5rem;
    display: block;
    margin-bottom: 0.5rem;
    opacity: 0.25;
    animation: float-moon 5s ease-in-out infinite;
}

.sidebar-decoration .deco-text {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.3);
    font-family: 'Amiri', serif;
}

@keyframes float-moon {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-6px) rotate(5deg);
    }
}

/* Navigation Links */
.nav-links {
    padding: 0.3rem 0;
    position: relative;
    z-index: 1;
}

.nav-links li {
    margin-bottom: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.nav-links li:last-child {
    border-bottom: none;
}

.nav-links a {
    display: flex;
    align-items: center;
    padding: 0.75rem 1.2rem;
    color: rgba(255, 255, 255, 0.72);
    font-weight: 500;
    font-size: 0.92rem;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    border-right: 3px solid transparent;
    position: relative;
    overflow: hidden;
}

.nav-links a::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.08), transparent);
    transition: width 0.4s ease;
    z-index: -1;
}

.nav-links a:hover::before {
    width: 100%;
}

.nav-links a:hover,
.nav-links a.active {
    color: #fff;
    border-right-color: rgba(255, 255, 255, 0.8);
    padding-right: 1.5rem;
}

.nav-links a.active {
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.1), transparent);
    color: #fff;
    font-weight: 600;
}

.nav-links i {
    width: 32px;
    text-align: center;
    margin-left: 10px;
    font-size: 1.05rem;
    transition: all 0.35s ease;
    color: rgba(255, 255, 255, 0.55);
}

.nav-links a:hover i {
    color: #fff;
    transform: scale(1.15);
}

.nav-links a.active i {
    color: #fff;
    transform: scale(1.1);
}

/* Submenu Styles */
.nav-links .submenu {
    display: none;
    background: rgba(0, 0, 0, 0.18);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.nav-links .has-submenu.open .submenu {
    display: block;
    animation: slideDown 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-links .submenu li {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.nav-links .submenu a {
    padding-left: 2.2rem;
    padding-right: 1.5rem;
    font-size: 0.88rem;
    color: rgba(255, 255, 255, 0.6);
}

.nav-links .submenu a:hover {
    color: #fff;
}

.nav-links .submenu a i {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.4);
}

.nav-links .submenu a:hover i {
    color: #fff;
}

.nav-links .dropdown-icon {
    margin-right: auto;
    margin-left: 0;
    font-size: 0.75rem;
    transition: transform 0.4s ease;
    color: rgba(255, 255, 255, 0.4);
}

.nav-links .has-submenu.open .dropdown-icon {
    transform: rotate(180deg);
    color: rgba(255, 255, 255, 0.8);
}

@keyframes slideDown {
    from {
        opacity: 0;
        max-height: 0;
        transform: translateY(-8px);
    }

    to {
        opacity: 1;
        max-height: 500px;
        transform: translateY(0);
    }
}


.main-content {
    flex: 1;
    margin-right: 280px;
    /* Offset for fixed sidebar */
    height: 100%;
    /* Full height of app-container */
    display: flex;
    flex-direction: column;
    /* Column layout */
    overflow: hidden;
    /* Prevent double scrollbars */
    padding: 0;
    /* Padding moved to wrapper */
}

.content-wrapper {
    flex: 1;
    /* Take remaining space */
    overflow-y: auto;
    /* Scrollable area */
    padding: 2.5rem;

    /* High Visibility Scrollbar */
    scrollbar-width: thin;
    scrollbar-color: var(--secondary-color) #f0f0f0;
}

.content-wrapper::-webkit-scrollbar {
    width: 12px;
}

.content-wrapper::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-left: 1px solid #e0e0e0;
}

.content-wrapper::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    /* Orange/Gold */
    border-radius: 6px;
    border: 3px solid #f0f0f0;
    /* Creates padding effect */
}

.content-wrapper::-webkit-scrollbar-thumb:hover {
    background: #d35400;
}

/* Page Header */
.page-header {
    background: white;
    padding: 2.5rem;
    border-radius: var(--radius);
    margin-bottom: 3rem;
    box-shadow: var(--shadow);
    text-align: center;
    border-bottom: 4px solid var(--secondary-color);
    position: relative;
    overflow: hidden;
}

.page-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, var(--secondary-color), var(--accent-color));
}

.page-header h1 {
    color: var(--primary-color);
    font-size: 2.2rem;
    margin-bottom: 0.8rem;
}

.page-header p {
    color: #7f8c8d;
    font-size: 1.1rem;
}

/* Grid & Cards */
.excellence-grid,
.grid-3 {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.excel-card,
.content-card {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow);
    transition: all 0.3s;
    border: 1px solid #f0f0f0;
    position: relative;
    display: flex;
    flex-direction: column;
}

.excel-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.excel-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 100%);
    /* Sidebar Blue */
    color: var(--white);
    /* White Icon */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
}

/* Flashy Button Animation */
.flash-button {
    background: linear-gradient(45deg, var(--primary-color), var(--accent-color));
    color: white;
    padding: 8px 20px;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: bold;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    transition: all 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    animation: pulse-btn 2.5s infinite;
    margin-top: auto;
    /* Pushes button to bottom of flex container */
    align-self: flex-start;
}

.flash-button:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

.flash-button::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
    transition: 0.5s;
    animation: shine-btn 3s infinite;
}

@keyframes pulse-btn {
    0% {
        box-shadow: 0 0 0 0 rgba(230, 126, 34, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(230, 126, 34, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(230, 126, 34, 0);
    }
}

@keyframes shine-btn {
    0% {
        left: -100%;
    }

    20% {
        left: 100%;
    }

    100% {
        left: 100%;
    }
}

/* Timeline / Metro Map (Infographic) */
.timeline-container {
    position: relative;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
}

.timeline-container::after {
    content: '';
    position: absolute;
    width: 6px;
    background-color: #e0e0e0;
    top: 0;
    bottom: 0;
    left: 50%;
    margin-left: -3px;
    border-radius: 5px;
}

.timeline-box {
    padding: 10px 40px;
    position: relative;
    width: 50%;
    box-sizing: border-box;
}

.right {
    left: auto;
    right: 0;
}

.left {
    left: 0;
    right: auto;
}

.node-icon {
    position: absolute;
    width: 50px;
    height: 50px;
    top: 20px;
    background: white;
    border-radius: 50%;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: white;
    box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.8);
}

.right .node-icon {
    left: -25px;
}

.left .node-icon {
    right: -25px;
}

.timeline-content {
    padding: 20px;
    background: white;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    position: relative;
    border-top: 4px solid var(--accent-color);
}

.timeline-content::before {
    content: " ";
    position: absolute;
    top: 30px;
    width: 0;
    height: 0;
    border: medium solid white;
}

.right .timeline-content::before {
    left: -10px;
    border-width: 10px 10px 10px 0;
    border-color: transparent white transparent transparent;
}

.left .timeline-content::before {
    right: -10px;
    border-width: 10px 0 10px 10px;
    border-color: transparent transparent transparent white;
}

.phase-1 .node-icon {
    background: #8e44ad;
}

.phase-1 .timeline-content {
    border-color: #8e44ad;
}

.phase-2 .node-icon {
    background: #e67e22;
}

.phase-2 .timeline-content {
    border-color: #e67e22;
}

.phase-3 .node-icon {
    background: #2980b9;
}

.phase-3 .timeline-content {
    border-color: #2980b9;
}

.phase-4 .node-icon {
    background: #27ae60;
}

.phase-4 .timeline-content {
    border-color: #27ae60;
}

.date-badge {
    background: #eee;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: bold;
    color: #555;
    display: inline-block;
    margin-bottom: 10px;
}

.timeline-title {
    margin-top: 0;
    font-size: 1.4rem;
    margin-bottom: 15px;
    color: #2c3e50;
}

.timeline-content ul li {
    margin-bottom: 8px;
    position: relative;
    padding-right: 20px;
    color: #555;
}

.timeline-content ul li::before {
    content: '•';
    color: inherit;
    position: absolute;
    right: 0;
    font-weight: bold;
    font-size: 1.2rem;
    line-height: 1;
}

@media screen and (max-width: 768px) {
    .timeline-container::after {
        left: auto;
        right: 30px;
    }

    .timeline-box {
        width: 100%;
        padding-left: 0;
        padding-right: 70px;
    }

    .right,
    .left {
        right: 0;
    }

    .node-icon {
        left: auto;
        right: 5px;
    }

    .right .timeline-content::before,
    .left .timeline-content::before {
        right: -10px;
        left: auto;
        border-width: 10px 0 10px 10px;
        border-color: transparent transparent transparent white;
    }
}

@media (max-width: 900px) {
    .app-container {
        display: block;
        /* Disable flex to prevent sidebar from taking space */
    }

    .sidebar {
        width: 260px;
        height: 100vh;
        position: fixed;
        top: 0;
        right: -280px;
        /* Hide to the right (outside viewport) */
        left: auto;
        z-index: 2000;
        /* High z-index to sit on top of everything */
        transition: right 0.3s ease-in-out;
        /* Transition on right property */
        transform: none;
        /* Reset transform */
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
    }

    .sidebar.active {
        right: 0;
        /* Slide in to the edge */
        transform: none;
    }

    .main-content {
        margin-right: 0;
        padding: 1.5rem;
        width: 100%;
    }

    /* Hamburger Menu Button */
    .menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        position: fixed;
        top: 20px;
        right: 20px;
        z-index: 2100;
        /* Above sidebar */
        background: var(--secondary-color);
        color: white;
        border: none;
        border-radius: 50%;
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
        cursor: pointer;
        box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
        transition: all 0.3s ease;
    }

    .menu-toggle:hover {
        transform: scale(1.1);
        background: #d35400;
    }

    /* Overlay */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1900;
        /* Below sidebar */
        backdrop-filter: blur(3px);
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }
}

.text-gold {
    color: var(--warning-color);
}

.text-purple {
    color: #8e44ad;
}

.text-blue {
    color: #2980b9;
}

/* .btn-print {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    border: none;
    font-size: 1.5rem;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    z-index: 2000;
} */

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(15px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

/* ═══════════════════════════════════════════════════════════ */
/* ▌  APP FOOTER - تصميم عصري متطور                         ▌ */
/* ═══════════════════════════════════════════════════════════ */
.app-footer {
    background: linear-gradient(135deg, #0a1628 0%, #12264a 50%, #1a3568 100%);
    color: white;
    padding: 1.2rem 1.5rem;
    text-align: center;
    width: 100%;
    border-top: none;
    position: relative;
    z-index: 100;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    margin-top: 0;
    overflow: hidden;
}

.app-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4) 20%, rgba(255, 255, 255, 0.7) 50%, rgba(255, 255, 255, 0.4) 80%, transparent);
}

.app-footer::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23ffffff' fill-opacity='0.025'%3E%3Cpath d='M20 20.5V18H0v-2h20v-2l2 3.5-2 3zM0 20.5V18h20v-2H0v-2l-2 3.5 2 3z'/%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
    z-index: 0;
}

/* Footer for landing page */
.home-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    border-radius: 0;
    margin-top: 0;
    background: rgba(10, 22, 40, 0.95);
    backdrop-filter: blur(8px);
}

.home-footer .app-footer {
    margin: 0;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}

.footer-content {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.copyright {
    font-size: 0.9rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.88);
    letter-spacing: 0.3px;
}

.copyright i {
    color: rgba(255, 255, 255, 0.7);
    margin: 0 3px;
}

.developer {
    font-size: 0.85rem;
    color: rgba(255, 255, 255, 0.65);
}

.dev-name {
    color: #fff;
    font-weight: 700;
    margin-right: 4px;
    text-shadow: 0 1px 4px rgba(255, 255, 255, 0.15);
}

@media (min-width: 768px) {
    .footer-content {
        flex-direction: row;
        justify-content: space-between;
        text-align: right;
    }

    .developer {
        margin-top: 0;
    }
}

@media print {
    .app-footer {
        display: none !important;
    }
}