/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Orbitron:wght@400;700;900&family=Noto+Sans+TC:wght@300;400;500;700&display=swap');

:root {
    --primary: #00d2ff;
    --secondary: #3a7bd5;
    --bg-dark: #050b14;
    --card-bg: rgba(15, 23, 42, 0.6);
    --glass-border: rgba(56, 189, 248, 0.2);
    --text-main: #e2e8f0;
    --text-muted: #94a3b8;
    --accent: #38bdf8;
    --success: #10b981;
    --warning: #f59e0b;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Noto Sans TC', sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    /* Subtle space background pattern */
    background-image: 
        radial-gradient(circle at 15% 50%, rgba(0, 210, 255, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 85% 30%, rgba(58, 123, 213, 0.05) 0%, transparent 50%);
    background-attachment: fixed;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Orbitron', sans-serif;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 2px;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.3s ease, text-shadow 0.3s ease;
}

a:hover {
    color: var(--primary);
    text-shadow: 0 0 8px rgba(0, 210, 255, 0.6);
}

/* Glassmorphism Utilities */
.glass-panel {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Typography */
.text-gradient {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Layout */
main {
    flex: 1;
    padding: 40px;
    margin-left: 280px; /* Sidebar width */
    width: calc(100% - 280px);
    transition: all 0.3s ease;
}

.section-title {
    text-align: center;
    margin-bottom: 40px;
    font-size: 2.5rem;
    position: relative;
    display: inline-block;
    left: 50%;
    transform: translateX(-50%);
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--primary), transparent);
}

/* Sidebar Navigation */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 280px;
    height: 100vh;
    z-index: 1000;
    background: rgba(5, 11, 20, 0.95);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border-right: 1px solid var(--glass-border);
    padding: 40px 20px;
    overflow-y: auto;
    transition: transform 0.3s ease;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 40px;
    padding-left: 10px;
    text-decoration: none;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-category {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 25px 0 10px 15px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: var(--text-main);
    border-radius: 10px;
    margin-bottom: 5px;
    transition: all 0.3s ease;
    font-size: 0.95rem;
}

.sidebar-nav li a:hover,
.sidebar-nav li a.active {
    background: rgba(0, 210, 255, 0.1);
    color: var(--primary);
    box-shadow: inset 0 0 15px rgba(0, 210, 255, 0.2);
    transform: translateX(5px);
}

/* Mobile Header (Hidden on Desktop) */
.mobile-header {
    display: none;
}

.hamburger {
    cursor: pointer;
    flex-direction: column;
    gap: 6px;
    z-index: 1100;
}

.hamburger span {
    width: 30px;
    height: 2px;
    background-color: var(--primary);
    transition: all 0.3s;
}

/* Footer */
footer {
    background: rgba(5, 11, 20, 0.9);
    border-top: 1px solid var(--glass-border);
    padding: 40px 20px;
    text-align: center;
    margin-top: auto;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
}

.footer-content p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Cards (for Index page - kept for reference if needed) */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.nav-card {
    display: block;
    padding: 30px;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.nav-card::before {
    content: '';
    position: absolute;
    top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.05), transparent);
    transform: skewX(-20deg);
    transition: left 0.5s;
}

.nav-card:hover::before {
    left: 150%;
}

.nav-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 210, 255, 0.2);
    border-color: var(--primary);
}

.nav-card h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

.nav-card p {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Topic List (for Index page list format) */
.topic-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.topic-list li a {
    display: block;
    padding: 20px 25px;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(56, 189, 248, 0.2);
    border-radius: 12px;
    transition: all 0.3s ease;
    text-decoration: none;
}

.topic-list li a:hover {
    background: rgba(0, 210, 255, 0.1);
    border-color: var(--primary);
    transform: translateX(10px);
}

.topic-list li h3 {
    font-size: 1.4rem;
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.topic-list li p {
    color: var(--text-muted);
    font-size: 1rem;
    margin: 0;
    line-height: 1.4;
}

/* Content Pages */
.content-section {
    padding: 30px;
    margin-bottom: 30px;
}

.content-section h2 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    border-bottom: 1px solid rgba(56, 189, 248, 0.3);
    padding-bottom: 10px;
    display: inline-block;
}

.content-section p {
    margin-bottom: 15px;
    font-size: 1.1rem;
}

.content-section ul, .content-section ol {
    margin-left: 20px;
    margin-bottom: 20px;
}

.content-section li {
    margin-bottom: 10px;
}

.sidebar-nav li {
    margin-bottom: 5px;
}

/* Submenu Styles */
.has-submenu {
    display: flex;
    flex-direction: column;
}

.submenu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    padding-right: 15px;
}

.submenu-header:hover {
    background: rgba(255, 255, 255, 0.05);
}

.toggle-icon {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
    color: var(--text-muted);
}

.submenu {
    list-style: none;
    padding-left: 25px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, margin 0.3s ease;
    margin-bottom: 0;
}

.submenu li a {
    font-size: 0.85rem;
    padding: 8px 10px;
}

.has-submenu.expanded .submenu {
    max-height: 200px;
    margin-top: 5px;
    margin-bottom: 10px;
}

.has-submenu.expanded .toggle-icon {
    transform: rotate(180deg);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 60px 20px;
    border-radius: 20px;
    margin-bottom: 50px;
    position: relative;
    overflow: hidden;
}

.hero h1 {
    font-size: 3.5rem;
    margin-bottom: 20px;
}

.hero p {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto;
    color: var(--text-muted);
}

/* Button */
.btn {
    display: inline-block;
    padding: 12px 24px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #fff;
    font-family: 'Orbitron', sans-serif;
    font-weight: bold;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn:hover {
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.6);
    transform: scale(1.05);
    color: #fff;
}

/* Media Queries */
@media (max-width: 992px) {
    main {
        margin-left: 0;
        width: 100%;
        padding: 100px 20px 40px;
    }

    .sidebar {
        transform: translateX(-100%);
        width: 280px;
        box-shadow: 20px 0 50px rgba(0, 0, 0, 0.5);
    }

    .sidebar.active {
        transform: translateX(0);
    }

    .mobile-header {
        display: flex;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        z-index: 1001;
        background: rgba(5, 11, 20, 0.95);
        backdrop-filter: blur(10px);
        padding: 15px 20px;
        justify-content: space-between;
        align-items: center;
        border-bottom: 1px solid var(--glass-border);
    }
}
