/* ===================================
   MAIN WEBSITE STYLES
   Eva Qi Personal Website - General Styles
   =================================== */

/* ===================================
   导航栏样式
   =================================== */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: rgba(26, 26, 46, 0.95);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    transform: translateY(0);
}

body:not(.has-navbar) .navbar {
    display: none;
}

.navbar.scrolled {
    background: rgba(26, 26, 46, 0.98);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo {
    font-family: 'Scheherazade New', 'Times New Roman', serif;
    font-size: 1.8rem;
    font-weight: 700;
    background: linear-gradient(45deg, #f093fb, #f5576c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-decoration: none;
    transition: all 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
    filter: brightness(1.2);
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 40px;
}

.nav-link {
    color: #ffffff;
    text-decoration: none;
    font-weight: 500;
    font-size: 1rem;
    position: relative;
    transition: all 0.3s ease;
    padding: 8px 0;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(45deg, #f093fb, #f5576c);
    transition: width 0.3s ease;
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

.nav-link:hover {
    color: #f093fb;
    transform: translateY(-2px);
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 5px;
    transition: all 0.3s ease;
}

.hamburger.active {
    transform: rotate(90deg);
}

.bar {
    width: 25px;
    height: 3px;
    background: linear-gradient(45deg, #f093fb, #f5576c);
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

.hamburger.active .bar:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active .bar:nth-child(2) {
    opacity: 0;
}

.hamburger.active .bar:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* ===================================
   MOBILE SIDEBAR
   =================================== */

.mobile-sidebar {
    position: fixed;
    top: 0;
    right: -100%;
    width: 85%;
    max-width: 400px;
    height: 100vh;
    background: rgba(26, 26, 46, 0.98);
    backdrop-filter: blur(20px);
    z-index: 2000;
    transition: right 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-left: 1px solid rgba(255, 255, 255, 0.1);
    overflow-y: auto;
}

.mobile-sidebar.active {
    right: 0;
}

.sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    font-family: 'Scheherazade New', 'Times New Roman', serif;
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(45deg, #f093fb, #f5576c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.close-sidebar {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 2rem;
    cursor: pointer;
    padding: 5px;
    transition: all 0.3s ease;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-sidebar:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: rotate(90deg);
}

.sidebar-menu {
    padding: 20px 0;
}

.sidebar-link {
    display: block;
    color: #ffffff;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 500;
    padding: 15px 30px;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
    position: relative;
}

.sidebar-link:hover,
.sidebar-link.active {
    background: rgba(240, 147, 251, 0.1);
    border-left-color: #f093fb;
    color: #f093fb;
    transform: translateX(10px);
}

.sidebar-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 0;
    background: linear-gradient(45deg, #f093fb, #f5576c);
    transition: width 0.3s ease;
    opacity: 0.1;
}

.sidebar-link:hover::before {
    width: 100%;
}

/* ===================================
   MOBILE RESPONSIVE DESIGN
   =================================== */

/* Tablets and mobile landscape */
@media (max-width: 768px) {
    /* Navigation responsive */
    .nav-menu {
        display: none;
    }
    
    .hamburger {
        display: flex;
    }
    
    .navbar {
        height: 60px;
    }
    
    .nav-container {
        height: 60px;
    }
    
    .logo {
        font-size: 1.5rem;
    }
}

/* Mobile portrait */
@media (max-width: 480px) {
    .nav-container {
        padding: 0 15px;
    }
    
    .logo {
        font-size: 1.3rem;
    }
}

/* Extra small devices */
@media (max-width: 320px) {
    .nav-container {
        padding: 0 10px;
    }
    
    .logo {
        font-size: 1.2rem;
    }
}

/* ===================================
   ACCESSIBILITY IMPROVEMENTS
   =================================== */

/* Focus states for accessibility */
.nav-link:focus-visible,
.logo:focus-visible,
.hamburger:focus-visible,
.close-sidebar:focus-visible,
.sidebar-link:focus-visible {
    outline: 2px solid #f093fb;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .navbar {
        background: rgba(0, 0, 0, 0.95);
        border-bottom: 2px solid #ffffff;
    }
    
    .nav-link {
        color: #ffffff;
    }
    
    .mobile-sidebar {
        background: rgba(0, 0, 0, 0.98);
        border-left: 2px solid #ffffff;
    }
    
    .sidebar-link {
        color: #ffffff;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .navbar,
    .mobile-sidebar,
    .nav-link,
    .sidebar-link,
    .hamburger,
    .close-sidebar {
        transition: none;
    }
    
    .hamburger.active {
        transform: none;
    }
    
    .hamburger.active .bar:nth-child(1),
    .hamburger.active .bar:nth-child(3) {
        transform: none;
    }
}
