/* ============================================
   Miwnix Tech — Header & Navigation
   ============================================ */

header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 20px 0;
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: var(--transition);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 800;
    color: white;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
}

.logo i {
    color: var(--primary);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 30px;
    list-style: none;
    margin-left: auto;
    /* Push nav links to the right */
    margin-right: 20px;
    /* Add spacing between links and controls */
}

.nav-links a {
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -5px;
    left: 0;
    background: var(--primary);
    transition: var(--transition);
}

.nav-links a:hover::after {
    width: 100%;
}

/* --- Hamburger --- */
.hamburger {
    display: none;
    width: 28px;
    height: 22px;
    position: relative;
    cursor: pointer;
    transition: var(--transition);
}

.hamburger i {
    display: none;
}

.hamburger::before,
.hamburger::after,
.hamburger span {
    content: '';
    position: absolute;
    width: 100%;
    height: 3px;
    background: white;
    border-radius: 3px;
    transition: all 0.3s ease;
    left: 0;
}

.hamburger::before {
    top: 0;
}

.hamburger span {
    top: 50%;
    transform: translateY(-50%);
    display: block;
}

.hamburger::after {
    bottom: 0;
}

/* Active state - Transform to X */
.hamburger.active::before {
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
}

.hamburger.active span {
    opacity: 0;
    transform: translateX(-100%);
}

.hamburger.active::after {
    bottom: 50%;
    transform: translateY(50%) rotate(-45deg);
}

/* --- Dropdown Menu --- */
.nav-links li {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(10px);
    width: 220px;
    background: rgba(0, 0, 0, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 10px 0;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 242, 255, 0.2);
    z-index: 1000;
}

.dropdown-menu::before {
    content: '';
    position: absolute;
    top: -5px;
    left: 50%;
    transform: translateX(-50%) rotate(45deg);
    width: 10px;
    height: 10px;
    background: rgba(0, 0, 0, 0.95);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-links li:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(15px);
}

.dropdown-menu li {
    display: block;
    width: 100%;
}

.dropdown-menu a {
    display: block;
    padding: 12px 20px;
    color: #ccc;
    font-size: 0.9rem;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.dropdown-menu a:hover {
    background: rgba(0, 242, 255, 0.1);
    color: var(--primary);
    padding-left: 25px;
}

.dropdown-menu li:last-child a {
    border-bottom: none;
}

.dropdown-menu a::after {
    display: none !important;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .nav-links {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 25px;
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        height: calc(100vh - 70px);
        background: rgba(5, 5, 5, 0.85);
        backdrop-filter: blur(20px);
        padding: 40px 20px;
        text-align: center;
        opacity: 0;
        visibility: hidden;
        transform: translateY(-20px);
        transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
        z-index: 9999;
        margin-left: 0;
        /* Reset margin on mobile */
        margin-right: 0;
    }

    .nav-links.active {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    .hamburger {
        display: block;
        color: white;
    }
}

/* --- Mobile Dropdown --- */
@media (max-width: 768px) {
    .nav-links .dropdown-menu {
        position: static;
        transform: none;
        width: 100%;
        background: transparent;
        border: none;
        box-shadow: none;
        padding: 0;
        display: none;
        opacity: 1;
        visibility: visible;
        margin-top: 10px;
    }

    .nav-links .dropdown-menu::before {
        display: none;
    }

    .nav-links li:hover .dropdown-menu {
        display: block;
        transform: none;
    }

    .nav-links .dropdown-menu a {
        text-align: center;
        color: #aaa;
        padding: 10px;
    }

    .nav-links .dropdown-menu a:hover {
        padding-left: 10px;
        color: var(--primary);
    }
}

/* --- Header Controls (Theme + Hamburger) --- */
.header-controls {
    display: flex;
    align-items: center;
    gap: 20px;
}

.header-controls .theme-dropdown a {
    text-decoration: none;
    color: white;
}

/* --- Responsive Visibility --- */
.mobile-only {
    display: none;
}

@media (max-width: 1024px) {
    .mobile-only {
        display: block;
    }

    .desktop-only {
        display: none !important;
    }
}