:root {
    --icons-width: 70px;
    --sub-width: 220px;
    --topbar-h: 70px;
    /* Colors (Light mode) */
    --color-bg-body: #fff;
    --color-bg-container: #f3f4fb;
    --color-bg-sidebar: #FAF7FB;
    --color-bg-content: #fff;
    --color-text-main: #29343D;
    --color-text-muted: #bab9c4;
    --color-accent: #635BFF;
    --color-hover-accent: #635bff36;
    --color-active-accent: #fff;
}

.dark {
    --color-bg-body: #1a2537;
    --color-bg-container: #222d45;
    --color-bg-sidebar: #222d45;
    --color-bg-content: #1a2537;
    --color-text-main: #f5f5f5;
    --color-text-muted: #aaaaaa;
    --color-accent: #8e7cff;
    --color-hover-accent: #8e7cff36;
    --color-active-accent: #fff;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}
/* Animation */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }

    100% {
        opacity: 1;
        transform: translateY(0);
    }
}


html, body {
    height: 100%;
    margin: 0;
    background: var(--color-bg-body);
}

/* navbar*/
.topbar {
    position: fixed;
    left: var(--icons-width);
    right: 0;
    top: 0;
    height: var(--topbar-h);
    z-index: 2000;
    background: var(--color-bg-body);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1rem;
}

.mood {
    margin-bottom: 17px;
    margin-right: 25px;
}


.fa-moon, .fa-sun {
    font-size: 25px;
    transition: all 0.4s ease;
    position: absolute;
    top: 0;
    left: 0;
}

.fa-moon {
    background: linear-gradient(135deg, #3A3A3A, #2C3E50);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.fa-sun {
    background: linear-gradient(135deg, #FFEB3B, #FF9800);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    opacity: 0;
    transform: scale(0.5) rotate(-180deg);
}

.dark .fa-sun {
    opacity: 1;
    transform: scale(1) rotate(0deg);
    animation: bounceIn 0.4s ease;
}

.dark .fa-moon {
    opacity: 0;
    transform: scale(0.5) rotate(180deg);
}

@keyframes bounceIn {
    0% {
        transform: scale(0.5) rotate(-30deg);
        opacity: 0;
    }

    60% {
        transform: scale(1.2) rotate(10deg);
        opacity: 1;
    }

    80% {
        transform: scale(0.9) rotate(-5deg);
    }

    100% {
        transform: scale(1) rotate(0deg);
    }
}

.dropdown {
    position: relative;
    margin-right: 20px;
    background: var(--color-bg-body);
}

    .dropdown button {
        color: var(--color-accent);
        color: var(--color-text-muted);
    }

        .dropdown button:hover {
            color: var(--color-accent);
        }

.dropdown-menu {
    z-index: 3000;
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--color-bg-body);
}

.dropdown-item:hover {
    color: var(--color-accent);
}

.dropdown-item {
    color: var(--color-text-main);
}

h5 {
    font-family: "Montserrat", sans-serif;
    font-weight: 800;
    font-style: normal;
    color: var(--color-accent);
    font-size: 32px;
    letter-spacing: 3px;
    margin-left: 15px;
    margin-bottom: 0;
    text-shadow: 0 0 20px rgba(99, 91, 255, 0.5), 0 0 40px rgba(99, 91, 255, 0.3);
    transition: all 0.3s ease;
    text-transform: uppercase;
}

/* ========== Navbar Brand & Logo ========== */
.navbar-brand {
    display: flex;
    align-items: center;
    text-decoration: none;
    gap: 12px;
    padding: 8px 16px;
    border-radius: 15px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.navbar-brand::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--color-hover-accent), transparent);
    transition: left 0.6s ease;
}

.navbar-brand:hover::before {
    left: 100%;
}

.navbar-brand:hover {
    background: linear-gradient(135deg, var(--color-hover-accent), transparent);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 91, 255, 0.15);
}

.navbar-brand:hover h5 {
    letter-spacing: 5px;
    text-shadow: 0 0 25px rgba(99, 91, 255, 0.7), 0 0 50px rgba(99, 91, 255, 0.5), 0 0 75px rgba(99, 91, 255, 0.3);
    transform: scale(1.05);
}

.navbar-logo {
    height: 48px;
    width: auto;
    transition: all 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    filter: drop-shadow(0 4px 8px rgba(99, 91, 255, 0.25));
    animation: logoFloat 3s ease-in-out infinite;
}

.navbar-brand:hover .navbar-logo {
    transform: scale(1.15) rotate(5deg);
    filter: drop-shadow(0 6px 15px rgba(99, 91, 255, 0.4)) brightness(1.1);
}

/* Logo Float Animation */
@keyframes logoFloat {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-5px);
    }
}

/* Pulse Effect on Logo */
@keyframes logoPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(99, 91, 255, 0.4);
    }
    70% {
        box-shadow: 0 0 0 15px rgba(99, 91, 255, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(99, 91, 255, 0);
    }
}

.navbar-brand:active .navbar-logo {
    transform: scale(0.95);
}

/* Dark Mode Enhancement */
.dark .navbar-logo {
    filter: drop-shadow(0 4px 12px rgba(142, 124, 255, 0.35)) brightness(1.1);
}

.dark .navbar-brand:hover .navbar-logo {
    filter: drop-shadow(0 6px 20px rgba(142, 124, 255, 0.5)) brightness(1.2);
}

/* Responsive Logo */
@media (max-width: 768px) {
    .navbar-logo {
        height: 40px;
    }
    
    h5 {
        font-size: 24px;
        letter-spacing: 2px;
        font-weight: 700;
    }
    
    .navbar-brand {
        padding: 6px 12px;
    }
    
    h6 {
        font-size: 15px;
        letter-spacing: 2px;
    }
    
    .nav-link {
        font-size: 13px;
    }
}


/* sidebar-icons*/
.sidebar-icons {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--icons-width);
    background: var(--color-bg-sidebar);
    color: var(--color-bg-body);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 10px 0;
    height: 100vh;
    overflow-y: hidden;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--color-accent) transparent;
    transition: all 0.3s ease;
    z-index: 1100;
}

    .sidebar-icons:hover {
        overflow-y: auto;
    }

    .sidebar-icons::-webkit-scrollbar {
        width: 6px;
    }

    .sidebar-icons::-webkit-scrollbar-thumb {
        background-color: var(--color-accent);
        border-radius: 20px;
    }

    .sidebar-icons::-webkit-scrollbar-track {
        background: transparent;
    }

    .sidebar-icons button {
        background: none;
        border: none;
        font-size: 1.5rem;
        color: var(--color-text-muted);
        width: 75%;
        padding: 12px 0;
        border-radius: 10px;
        cursor: pointer;
        margin: 0;
        transition: all 0.2s ease;
    }

        .sidebar-icons button:hover {
            background: var(--color-hover-accent);
            color: var(--color-accent);
            transform: scale(1.1);
        }

        .nav-link.active {
            background: linear-gradient(90deg, #6A5BFF, #8E7CFF);
            border-radius: 10px;
            color: var(--color-active-accent);
            font-weight: 600;
            box-shadow: 0 4px 12px rgba(99, 91, 255, 0.3);
        }

        .nav-link.active::before {
            width: 4px;
            background: white;
        }

    .sidebar-icons button.active,
        .sidebar-icons button.active {
            background: linear-gradient(90deg, #6A5BFF, #8E7CFF);
            border-radius: 10px;
            color: var(--color-active-accent);
            box-shadow: 0 4px 12px rgba(99, 91, 255, 0.4);
        }

            .nav-link.active:hover {
                color: var(--color-bg-body);
            }

    /* ===== HR Line ===== */
    .sidebar-icons hr {
        width: 70%;
        border: 0;
        border-top: 1px solid var(--color-text-muted);
        margin: 8px 0; /* تصغير المسافة */
        opacity: 0.4;
    }

.submenu {
    position: fixed;
    left: var(--icons-width);
    top: var(--topbar-h);
    width: var(--sub-width);
    height: calc(100vh - var(--topbar-h));
    padding: 1rem;
    box-sizing: border-box;
    z-index: 1040;
    transform: translateX(0);
    opacity: 1;
    transition: transform 0.2s ease, opacity 0.2s ease;
    overflow-y: auto;
    background-color: var(--color-bg-body);
}

    .submenu.hidden {
        transform: translateX(calc(-1 * (var(--sub-width) + 20px)));
        opacity: 0;
        pointer-events: none;
    }

.hidden {
    visibility: hidden;
    position: absolute;
    opacity: 0;
    pointer-events: none;
}


h6 {
    font-family: "Rajdhani", sans-serif;
    color: var(--color-text-main);
    text-transform: uppercase;
    letter-spacing: 2.5px;
    font-weight: 600;
    font-size: 16px;
    margin-bottom: 15px;
    position: relative;
    padding-bottom: 8px;
}

h6::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: linear-gradient(90deg, var(--color-accent), transparent);
    border-radius: 2px;
}

.nav-link {
    font-family: "Poppins", sans-serif;
    color: var(--color-text-main);
    font-weight: 400;
    font-size: 14px;
    transition: all 0.3s ease;
    padding: 10px 15px;
    border-radius: 8px;
    position: relative;
}

.nav-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 60%;
    background: var(--color-accent);
    border-radius: 0 4px 4px 0;
    transition: width 0.3s ease;
}

    .nav-link:hover {
        color: var(--color-accent);
        background: var(--color-hover-accent);
        transform: translateX(5px);
        font-weight: 500;
    }

    .nav-link:hover::before {
        width: 4px;
    }

.app {
    margin-left: calc(var(--icons-width) + var(--sub-width));
    transition: margin-left 0.2s ease;
    min-height: 100vh;
    overflow: visible;
}

    .app.submenu-hidden {
        margin-left: var(--icons-width);
    }

.main {
    padding-top: var(--topbar-h);
    display: flex;
    box-sizing: border-box;
}

.container {
    width: 97%;
    padding: 40px 25px;
    background: var(--color-bg-container);
    border-radius: 25px;
}

.content {
    border-radius: 25px;
    flex: 1 1 auto;
    padding: 1rem;
    margin: auto;
    width: 98%;
    background: var(--color-bg-content);
    height: calc(100vh - var(--topbar-h));
}






/* overlay */
.overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    display: none;
    z-index: 1990;
}

.sidebar-icons, .submenu {
    transition: transform 0.28s ease, opacity 0.2s ease;
}

@media (max-width: 991px) {

    .topbar {
        left: 0 !important;
        right: 0;
    }

    .app {
        margin-left: 0 !important;
    }

    .sidebar-icons #menuToggle {
        display: none;
    }

    .sidebar-icons {
        position: fixed;
        left: 0;
        top: 0;
        bottom: 0;
        transform: translateX(-110%);
        z-index: 2000;
        background: var(--sidebar-bg, var(--color-bg-sidebar));
        margin-top: var(--icons-width);
    }

    .submenu {
        position: fixed;
        left: calc(var(--icons-width));
        top: var(--topbar-h);
        width: var(--sub-width);
        height: calc(100vh - var(--topbar-h));
        transform: translateX(-150%);
        z-index: 2000;
        background: var(--submenu-bg, var(--color-bg-body));
    }

    body.mobile-sidebar-open .sidebar-icons,
    body.mobile-sidebar-open .submenu {
        transform: translateX(0);
    }

    body.mobile-sidebar-open .overlay {
        display: block;
    }

    body.mobile-sidebar-open {
        overflow: hidden;
    }

    .btn {
        background: none;
        border: none;
        font-size: 1.5rem;
        color: var(--color-text-muted);
        width: calc(var(--icons-width)*0.75);
        padding: 10px 0;
        border-radius: 10px;
        cursor: pointer;
    }

        .btn:hover {
            background: var(--color-hover-accent);
            color: var(--color-accent);
        }

        .btn.active {
            background: linear-gradient(90deg, #6A5BFF, #8E7CFF);
            border-radius: 10px;
            color: #fff;
        }
}
