/* Responsive styles for Q+2077: Code Frontier website */

/* General styles for mobile devices */
body {
    font-size: 16px; /* Base font size */
    line-height: 1.5; /* Improved readability */
}

/* Navigation bar */
nav {
    flex-direction: column; /* Stack items vertically on small screens */
}

nav a {
    padding: 15px; /* Increased padding for touch targets */
}

/* Hero Section */
.hero {
    padding: 20px; /* Add padding for mobile */
    text-align: center; /* Center text on mobile */
}

/* Content sections */
.content {
    flex-direction: column; /* Stack content vertically on small screens */
}

.about-game, .how-it-works, .about-us {
    padding: 20px; /* Add padding for mobile */
}

/* Two-column layout for "关于游戏" section */
@media (min-width: 768px) {
    .about-game {
        display: flex; /* Use flexbox for larger screens */
        justify-content: space-between; /* Space out columns */
    }
}

/* Time axis for "如何运作" section */
.timeline {
    display: flex;
    flex-direction: column; /* Stack timeline items vertically */
}

/* Footer */
footer {
    text-align: center; /* Center footer content */
    padding: 20px; /* Add padding for mobile */
}

/* 导航栏基础样式 */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--glass-bg);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 245, 255, 0.3);
    transition: all 0.3s ease;
}

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

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1001;
}

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

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 4px;
    transition: all 0.3s ease;
    position: relative;
}

.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
    z-index: 1001;
}

.bar {
    width: 25px;
    height: 3px;
    background: var(--text-primary, #ffffff);
    transition: all 0.3s ease;
    border-radius: 2px;
}

/* 桌面端导航菜单 */
.nav-menu {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 30px;
}

.nav-item {
    position: relative;
}

.nav-link {
    color: #fff;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    padding: 10px 0;
    transition: all 0.3s ease;
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: #00ff9f;
    text-shadow: 0 0 5px rgba(0, 255, 159, 0.5);
}

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

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

/* 汉堡菜单按钮 */
.hamburger {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 5px;
    z-index: 1001;
}

.hamburger .bar {
    width: 25px;
    height: 3px;
    background: #fff;
    margin: 3px 0;
    transition: all 0.3s ease;
    border-radius: 2px;
}

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

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

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

/* 移动端样式 */
@media screen and (max-width: 768px) {
    .navbar-container {
        padding: 0 15px;
        height: 70px;
    }
    
    .brand-text {
        font-size: 20px;
    }

    .logo {
        width: 35px;
        height: 35px;
    }
    
    /* 显示汉堡菜单 */
    .hamburger {
        display: flex;
    }
    
    /* 隐藏桌面端菜单 */
    .nav-menu {
        position: fixed;
        top: 0;
        right: -100vw;
        width: 280px;
        height: 100vh;
        background: rgba(10, 10, 10, 0.98);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        border-left: 2px solid rgba(0, 245, 255, 0.3);
        box-shadow: -10px 0 30px rgba(0, 0, 0, 0.5);
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 30px;
        padding: 80px 20px;
        z-index: 1000;
        transition: right 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        overflow-y: auto;
    }
    
    /* 菜单激活状态 */
    .nav-menu.active {
        right: 0;
    }
    
    /* 导航项样式 */
    .nav-item {
        width: 100%;
        text-align: center;
        margin: 0;
        position: relative; /* 添加相对定位 */
    }
    
    .nav-link {
        display: block;
        width: 100%;
        padding: 15px 20px;
        font-size: 1.1rem;
        color: var(--text-secondary, #b0b0b0);
        text-decoration: none;
        border-radius: 8px;
        transition: all 0.3s ease;
        text-transform: uppercase;
        letter-spacing: 1px;
        font-weight: 500;
        position: relative; /* 添加相对定位用于伪元素 */
    }
    
    /* 移动端导航链接的底部横线 */
    .nav-link::after {
        content: '';
        position: absolute;
        bottom: 8px; /* 距离底部的距离 */
        left: 50%; /* 从中心开始 */
        transform: translateX(-50%); /* 居中对齐 */
        width: 0; /* 初始宽度为0 */
        height: 2px;
        background: linear-gradient(90deg, var(--neon-blue, #00f5ff), var(--neon-purple, #b224ef));
        transition: width 0.3s ease;
        border-radius: 1px;
    }
    
    .nav-link:hover::after,
    .nav-link.active::after {
        width: calc(100% - 40px); /* 100%宽度减去左右padding */
    }
    
    .nav-link:hover,
    .nav-link.active {
        color: var(--neon-blue, #00f5ff);
        background: rgba(0, 245, 255, 0.1);
        text-shadow: 0 0 10px var(--neon-blue, #00f5ff);
        transform: translateX(10px);
    }
    
    /* 如果你想要横线完全覆盖整个链接宽度，使用这个版本 */
    .nav-link.full-width::after {
        width: 100%;
        left: 0;
        transform: none;
    }
    
    .nav-link.full-width:hover::after,
    .nav-link.full-width.active::after {
        width: 100%;
    }
    
    /* 汉堡菜单动画 */
    .hamburger.active .bar:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
        background: var(--neon-blue, #00f5ff);
    }
    
    .hamburger.active .bar:nth-child(2) {
        opacity: 0;
        transform: translateX(-20px);
    }
    
    .hamburger.active .bar:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
        background: var(--neon-blue, #00f5ff);
    }
    
    /* 防止菜单打开时背景滚动 */
    body.menu-open {
        overflow: hidden;
        height: 100vh;
    }
    
    /* 遮罩层 */
    .nav-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.6);
        z-index: 999;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }
    
    .nav-overlay.active {
        opacity: 1;
        visibility: visible;
    }
}

/* 超小屏幕优化 */
@media screen and (max-width: 480px) {
    .navbar-container {
        padding: 0 10px;
    }
    
    .nav-menu {
        width: 100%;
        right: -100vw;
    }
    
    .nav-link {
        font-size: 1rem;
        padding: 12px 15px;
    }
    .zones-grid{
        grid-template-columns:none;
    }
    .progress-card{
        padding: 10px;
    }
}

/* 确保在大屏幕上恢复正常显示 */
@media (min-width: 769px) {
    .hamburger {
        display: none !important;
    }
    
    .nav-menu {
        position: static !important;
        width: auto !important;
        height: auto !important;
        background: none !important;
        backdrop-filter: none !important;
        border: none !important;
        box-shadow: none !important;
        flex-direction: row !important;
        justify-content: flex-end !important;
        gap: 40px !important;
        padding: 0 !important;
        z-index: auto !important;
        transition: none !important;
        overflow: visible !important;
    }
    
    .nav-item {
        width: auto !important;
        text-align: left !important;
    }
    
    .nav-link {
        display: inline-block !important;
        width: auto !important;
        padding: 8px 16px !important;
        font-size: 1rem !important;
        text-transform: none !important;
        letter-spacing: normal !important;
        font-weight: 500 !important;
    }
    
    .nav-overlay {
        display: none !important;
    }
    
    body.menu-open {
        overflow: auto !important;
        height: auto !important;
    }
    
    .nav-link::after {
        bottom: -2px !important;
        left: 50% !important;
        transform: translateX(-50%) !important;
        width: 0 !important;
    }
    
    .nav-link:hover::after,
    .nav-link.active::after {
        width: 100% !important;
    }
}

/* 导入关于我们的样式 */
@import url('about-us.css');