:root {
    /* Color Palette - Light Mode */
    --bg-color: #f8fafc;
    --bg-sidebar: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --border-color: #e2e8f0;
    --card-bg: #ffffff;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    /* Variables */
    --sidebar-width: 350px;
    --border-radius: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dark-theme {
    /* Color Palette - Dark Mode */
    --bg-color: #0f172a;
    --bg-sidebar: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #60a5fa;
    --accent-hover: #3b82f6;
    --border-color: #334155;
    --card-bg: #1e293b;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.5);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.4), 0 2px 4px -2px rgb(0 0 0 / 0.4);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.5), 0 4px 6px -4px rgb(0 0 0 / 0.5);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.6;
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-x: hidden;
}

/* Layout */
.app-container {
    display: flex;
    height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 10;
    transition: var(--transition);
}

/* Custom Scrollbar for Sidebar */
.sidebar::-webkit-scrollbar {
    width: 6px;
}
.sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
    background-color: var(--border-color);
    border-radius: 10px;
}

.sidebar-header {
    padding: 24px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    background-color: var(--bg-sidebar);
    z-index: 11;
    backdrop-filter: blur(10px);
}

.sidebar-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.025em;
    background: linear-gradient(135deg, var(--accent) 0%, #a855f7 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.theme-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.theme-toggle:hover {
    background-color: var(--border-color);
    color: var(--text-main);
}

.hidden {
    display: none !important;
}

/* Table of Contents List */
.toc-list {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toc-item {
    display: flex;
    align-items: flex-start;
    padding: 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.9rem;
    position: relative;
    overflow: hidden;
}

.toc-item:hover {
    background-color: var(--border-color);
    color: var(--text-main);
    transform: translateX(4px);
}

.toc-item.active {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--accent);
    font-weight: 500;
}

.toc-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background-color: var(--accent);
    border-radius: 0 4px 4px 0;
}

.toc-num {
    font-variant-numeric: tabular-nums;
    font-weight: 600;
    margin-right: 12px;
    color: var(--accent);
    min-width: 20px;
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    padding: 40px 60px;
    max-width: 1000px;
    margin-right: auto;
}

.main-header {
    margin-bottom: 40px;
    text-align: center;
}

.main-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.05em;
    margin-bottom: 8px;
    color: var(--text-main);
}

.main-header p {
    color: var(--text-muted);
    font-size: 1.1rem;
}

/* Accordions */
.questions-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.accordion-item {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    transition: var(--transition);
    scroll-margin-top: 40px;
}

.accordion-item:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}

.accordion-header {
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 20px 24px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text-main);
    font-size: 1.05rem;
    font-weight: 500;
    transition: var(--transition);
}

.accordion-header:hover {
    color: var(--accent);
}

.accordion-title-wrap {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    flex: 1;
    padding-right: 16px;
}

.accordion-num {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--accent);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.accordion-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    color: var(--text-muted);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.accordion-item.active .accordion-icon {
    transform: rotate(180deg);
    color: var(--accent);
}

.accordion-item.active {
    box-shadow: var(--shadow-md);
    border-color: var(--accent);
}

.accordion-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s ease, opacity 0.3s ease;
    padding: 0 24px;
    opacity: 0;
}

.accordion-item.active .accordion-content {
    padding: 0 24px 24px 24px;
    opacity: 1;
}

.accordion-body {
    padding-top: 16px;
    border-top: 1px solid var(--border-color);
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1.8;
}

.accordion-body p {
    margin-bottom: 1.2rem;
}

.accordion-body p:last-child {
    margin-bottom: 0;
}

.accordion-body strong {
    color: var(--text-main);
    font-weight: 600;
}


.main-footer {
    margin-top: 60px;
    text-align: center;
    padding-bottom: 40px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* Responsive Design */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 300px;
    }
    .main-content {
        padding: 30px;
    }
}

@media (max-width: 768px) {
    .app-container {
        flex-direction: column;
    }
    
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        max-height: 300px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .main-content {
        margin-left: 0;
        width: 100%;
        padding: 20px;
    }
}
