/* ====== Header الأساسي ====== */

* {
    scroll-behavior: smooth !important;
}

body {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: all 0.5s ease !important;
}

header {
    position: fixed;
    width: 100% !important;
    left: 0;
    top: 0;
    z-index: 50;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

/* الهيدر في الوضع العادي */
#main-header.scrolled {
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.7);
}

/* الهيدر في الوضع الدارك */
.dark #main-header.scrolled {
    box-shadow: 0 2px 5px rgba(255, 255, 255, 0.3);
}

.toggle {
    display: none !important;
}

.dark-light-mood {
    position: fixed;
    bottom: 20px;
    right: 20px;
    transform: translateY(-50%);
    z-index: 1000;
    cursor: pointer;
    transition-duration: 0.5s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

@media only screen and (max-width: 767px) {
    .dark-light-mood {
        bottom: 10px;
    }
}

/* ====== Responsive elements ====== */
@media only screen and (max-width: 767px) {
    .logo span {
        font-size: 25px !important;
    }

    .logo svg {
        width: 32px !important;
        height: 32px !important;
    }
    .toggle {
        display: flex !important;
    }

    nav {
        display: flex;
        flex-direction: column;
        gap: 10px;
        /* background-color: #e6f0ed !important; */
        position: absolute;
        top: calc(100% + 20px);
        left: calc(-100% - 50px);
        width: 100%;
        z-index: 999;
        transition: 0.5s;
        background: transparent;
    }
    nav a {
        font-size: 18px;
        text-align: center;
        margin: 3px 0 !important;
        margin-left: 0 !important;
        border-radius: 20px;
        border: #19183b 3px solid;
        display: block;
        width: 90%;
        background-color: #e6f0ed !important;
        padding: 6px 0;
    }
    nav a:hover {
        background-color: #19183b !important;
        color: #e6f0ed !important;
    }

    .dark nav a {
        border: #fff 3px solid;
        background-color: #19183b !important;
        color: #e6f0ed !important;
    }
    .dark nav a:hover {
        background-color: #fff !important;
        color: #19183b !important;
    }

    .active {
        left: 0;
    }
    nav.active a {
        font-size: 18px;
        text-align: center;
        margin: 3px 0 !important;
        margin-left: 0 !important;
    }
}

@media (min-width: 768px) {
    nav {
        display: flex !important;
        position: static;
        flex-direction: row;
        background: transparent;
    }
}

/* ====== أيقونة التوجل (switch) ====== */
/* From Uiverse.io by vinodjangid07 */
#checkbox {
    display: none;
}

.toggle {
    position: relative;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition-duration: 0.5s;
}

.bars {
    width: 100%;
    height: 4px;
    background-color: #19183b;
    border-radius: 4px;
}
.dark .bars {
    background-color: #e6f0ed;
}

#bar2 {
    transition-duration: 0.8s;
}

#bar1,
#bar3 {
    width: 70%;
}

#checkbox:checked + .toggle .bars {
    position: absolute;
    transition-duration: 0.5s;
}

#checkbox:checked + .toggle #bar2 {
    transform: scaleX(0);
    transition-duration: 0.5s;
}

#checkbox:checked + .toggle #bar1 {
    width: 100%;
    transform: rotate(45deg);
    transition-duration: 0.5s;
}

#checkbox:checked + .toggle #bar3 {
    width: 100%;
    transform: rotate(-45deg);
    transition-duration: 0.5s;
}

#checkbox:checked + .toggle {
    transition-duration: 0.5s;
    transform: rotate(180deg);
}
