/* Main CSS File - Wiki Style Layout - Consolidated */

/* Base Styles and CSS Variables */
:root {
    /* Light Mode Colors */
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --secondary-color: #64748b;
    --accent-color: #f59e0b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    
    /* Light Mode Text */
    --text-primary: #212529;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    
    /* Light Mode Backgrounds */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-code: #f8fafc;
    --bg-hover: #f1f5f9;
    --input-bg: #ffffff;
    --card-bg: #ffffff;
    
    /* Light Mode Borders */
    --border-color: #e2e8f0;
    --border-light: #f1f5f9;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;
    
    /* Transitions */
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Source Code Pro', Consolas, monospace;
    --line-height: 1.6;
    --line-height-tight: 1.4;
    --line-height-loose: 1.7;

    /* Wiki Specific Variables */
    --sidebar-width: 240px;
    --sidebar-collapsed-width: 60px;
    --header-height: 60px;
    --content-max-width: 100%;
    --border-radius: 8px;
}

/* Dark Mode Variables */
[data-theme="dark"] {
    /* Dark Mode Colors */
    --primary-color: #60a5fa;
    --primary-hover: #3b82f6;
    --primary-dark: #1d4ed8;
    --primary-light: #1e3a8a;
    --secondary-color: #94a3b8;
    --accent-color: #fbbf24;
    --success-color: #34d399;
    --warning-color: #fbbf24;
    --error-color: #f87171;
    
    /* Dark Mode Text */
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    
    /* Dark Mode Backgrounds */
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-code: #1e293b;
    --bg-hover: #334155;
    --input-bg: #1e293b;
    --card-bg: #1e293b;
    
    /* Dark Mode Borders */
    --border-color: #334155;
    --border-light: #475569;
    
    /* Dark Mode Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
}

/* System preference detection */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --primary-color: #60a5fa;
        --primary-hover: #3b82f6;
        --secondary-color: #94a3b8;
        --accent-color: #fbbf24;
        --success-color: #34d399;
        --warning-color: #fbbf24;
        --error-color: #f87171;
        
        --text-primary: #f1f5f9;
        --text-secondary: #cbd5e1;
        --text-muted: #94a3b8;
        
        --bg-primary: #0f172a;
        --bg-secondary: #1e293b;
        --bg-tertiary: #334155;
        --bg-code: #1e293b;
        
        --border-color: #334155;
        --border-light: #475569;
    }
}

/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: var(--transition);
}

/* Typography */
h1 {
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0 0 0.75rem;
    color: var(--text-primary);
    line-height: 1.2;
}

h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem;
    color: var(--text-primary);
    line-height: 1.3;
}

h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 1.5rem 0 0.75rem;
    color: var(--text-primary);
    line-height: 1.4;
}

h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 1rem 0 0.5rem;
    color: var(--text-primary);
}

p {
    margin: 0 0 1rem;
    color: var(--text-secondary);
}

.lead {
    font-size: 1rem;
    color: var(--text-primary);
    margin-bottom: 1.5rem;
}

/* Lists */
ul, ol {
    margin: 0 0 1rem;
    padding-left: 1.5rem;
}

li {
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

li strong {
    color: var(--text-primary);
    font-weight: 600;
}

/* Links */
a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

/* Code */
code {
    background: var(--bg-code);
    color: var(--text-primary);
    padding: 0.125rem 0.25rem;
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 0.875em;
}

pre {
    background: var(--bg-code);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    overflow-x: auto;
    font-family: var(--font-mono);
    line-height: 1.5;
}

/* Code Blocks */
.code-block {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin: 1.5rem 0;
    overflow: hidden;
}

.code-block pre {
    margin: 0;
    padding: 1rem;
    overflow-x: auto;
    font-family: 'JetBrains Mono', 'Fira Code', Consolas, monospace;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-primary);
}

.code-block code {
    background: none;
    padding: 0;
    font-family: inherit;
}

/* Form Elements */
input, textarea, select {
    background: var(--bg-primary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

input:focus, textarea:focus, select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Focus Styles */
:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Selection */
::selection {
    background: var(--primary-color);
    color: white;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-tertiary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* Layout Components */

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--card-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: var(--transition);
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed-width);
}

/* Sidebar Header */
.sidebar-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 50px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
}

.logo-icon {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
}

.logo-text {
    font-size: 1rem;
    transition: var(--transition);
}

.sidebar.collapsed .logo-text {
    opacity: 0;
    width: 0;
    overflow: hidden;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: var(--transition);
}

.sidebar-toggle:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

/* Search */
.search-container {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border-color);
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
}

.search-box i {
    position: absolute;
    left: 0.75rem;
    color: var(--text-secondary);
    z-index: 1;
}

.search-box input {
    width: 100%;
    padding: 0.75rem 0.75rem 0.75rem 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-clear {
    position: absolute;
    right: 0.5rem;
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem;
    border-radius: 4px;
    transition: var(--transition);
}

.search-clear:hover {
    color: var(--text-primary);
    background: var(--bg-hover);
}

/* Navigation */
.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.nav-section {
    margin-bottom: 0;
    border-bottom: 1px solid var(--border-color);
}

.nav-section:last-child {
    border-bottom: none;
}

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

.nav-link {
    display: flex;
    align-items: center;
    padding: 0.5rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
    font-size: 0.8rem;
    line-height: 1.4;
}

.nav-link:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
}

.nav-link.active {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-left-color: var(--primary-color);
    font-weight: 500;
}

/* Dropdown Navigation */
.nav-dropdown {
    position: relative;
}

.nav-dropdown-toggle {
    position: relative;
}

.nav-dropdown-toggle .dropdown-icon {
    margin-left: auto;
    transition: var(--transition);
    font-size: 0.7rem;
}

.nav-dropdown.active .dropdown-icon {
    transform: rotate(180deg);
}

.nav-dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    z-index: 1000;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.3s ease;
    margin-top: 0.25rem;
}

.nav-dropdown.active .nav-dropdown-menu {
    max-height: 500px;
    opacity: 1;
}

.nav-dropdown-menu .nav-link {
    padding: 0.375rem 1.5rem;
    font-size: 0.75rem;
    border-left: none;
    border-bottom: 1px solid var(--border-light);
}

.nav-dropdown-menu .nav-link:last-child {
    border-bottom: none;
}

.nav-dropdown-menu .nav-link:hover {
    background: var(--bg-hover);
    border-left: none;
}

.nav-dropdown-menu .nav-link.active {
    background: var(--primary-light);
    color: var(--primary-color);
    border-left: none;
}

/* Sidebar Footer */
.sidebar-footer {
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border-color);
}

/* Main Content */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    transition: var(--transition);
}

.sidebar.collapsed + .main-content {
    margin-left: var(--sidebar-collapsed-width);
}

/* Content Header */
.content-header {
    position: sticky;
    top: 0;
    background: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 100;
    backdrop-filter: blur(10px);
}

.header-auth {
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.header-auth .btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    min-width: 80px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 0.25rem;
}

.header-auth .auth-section {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.header-user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.5rem 1rem;
    min-height: 36px;
}

.header-user-info .user-avatar {
    width: 2rem;
    height: 2rem;
    background: var(--primary-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 0.875rem;
}

.header-user-info .user-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.header-user-info .user-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
}

.header-user-info .btn-logout {
    background: transparent;
    border: none;
    color: var(--text-secondary);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0.25rem 0;
    transition: var(--transition);
}

.header-user-info .btn-logout:hover {
    color: var(--primary-color);
}

.credits-link {
    margin-left: 1rem;
}

.theme-toggle {
    margin-right: 1rem;
}

.theme-toggle .btn {
    padding: 0.5rem;
    min-width: 80px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle .btn i {
    font-size: 0.875rem;
}

.credits-link a {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
    transition: var(--transition);
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--bg-secondary);
    min-width: 80px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.credits-link a:hover {
    color: var(--primary-color);
    background: var(--bg-hover);
    border-color: var(--primary-color);
}

/* Sidebar Footer Elements */
.sidebar-footer .theme-toggle {
    margin-bottom: 0.75rem;
}

.sidebar-footer .theme-toggle .btn,
.sidebar-footer .theme-toggle .theme-btn {
    width: 100%;
    height: 40px;
    justify-content: center;
    font-size: 0.875rem;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    border-radius: var(--border-radius);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    transition: var(--transition);
}

.sidebar-footer .theme-toggle .btn:hover,
.sidebar-footer .theme-toggle .theme-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary-color);
}

.sidebar-footer .credits-link {
    margin-top: 0;
}

.sidebar-footer .credits-link .btn {
    width: 100%;
    height: 40px;
    justify-content: center;
    font-size: 0.875rem;
    padding: 0.75rem 1rem;
    display: flex;
    align-items: center;
    border-radius: var(--border-radius);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    transition: var(--transition);
}

.sidebar-footer .credits-link .btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary-color);
}

/* Back to Main Button */
.back-to-main {
    background: var(--primary-color) !important;
    color: white !important;
    border-radius: var(--border-radius);
    margin: 0.5rem 0;
    font-weight: 600;
    transition: var(--transition);
}

.back-to-main:hover {
    background: var(--primary-hover) !important;
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.back-to-main i {
    margin-right: 0.5rem;
}

/* Discord Widget */
.discord-widget-container {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    text-align: center;
}

.discord-widget-container h3 {
    margin: 0 0 1rem 0;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.discord-widget-container h3 i {
    color: #5865F2; /* Discord brand color */
}

.discord-widget-container p {
    margin: 0 0 1.5rem 0;
    color: var(--text-secondary);
}

.discord-widget {
    display: flex;
    justify-content: center;
    align-items: center;
}

.discord-widget iframe {
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.discord-widget iframe:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.discord-invite-link {
    margin-top: 1.5rem;
}

.discord-invite-link .btn {
    background: #5865F2; /* Discord brand color */
    border-color: #5865F2;
    color: white;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
}

.discord-invite-link .btn:hover {
    background: #4752C4;
    border-color: #4752C4;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.discord-invite-link .btn i {
    margin-right: 0.5rem;
}

/* Fallout Anomaly Tab */
.fallout-anomaly-tab {
    margin-top: 0;
    border-top: none;
    padding-top: 0;
}

.fallout-anomaly-tab::before {
    content: '';
    display: block;
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}

.fallout-anomaly-link {
    background: transparent !important;
    color: var(--text-primary) !important;
    border: none !important;
    border-radius: 0;
    margin: 0;
    font-weight: 500;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    text-decoration: none;
    border-left: 3px solid transparent;
}

.fallout-anomaly-link:hover {
    background: var(--bg-hover) !important;
    color: var(--primary-color) !important;
    border-left-color: var(--primary-color) !important;
    transform: none;
    box-shadow: none;
}

.fallout-anomaly-link i {
    font-size: 0.875rem;
    color: var(--primary-color);
}

.radiation-icon {
    animation: rotate 2s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Discord Widget */
@media (max-width: 768px) {
    .discord-widget iframe {
        width: 100% !important;
        max-width: 350px;
        height: 400px !important;
    }
}

@media (max-width: 480px) {
    .discord-widget iframe {
        height: 350px !important;
    }
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.breadcrumb-item {
    color: var(--text-secondary);
}

.breadcrumb-item.active {
    color: var(--text-primary);
    font-weight: 500;
}

.breadcrumb i {
    font-size: 0.75rem;
}

.header-actions {
    display: flex;
    gap: 0.5rem;
}

/* Content Area */
.content-area {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 2rem;
    margin-right: 320px; /* Make room for TOC */
}

.content-section {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.content-section.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* UI Components */

/* User Info */
.user-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--bg-hover);
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    align-self: center;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    width: 100%;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-align: center;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--border-radius);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border-color);
}

.btn-outline:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--primary-color);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

.btn-logout {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.375rem 0.75rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 0.375rem;
    width: 100%;
    justify-content: center;
    margin-top: 0.5rem;
}

.btn-logout:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-color: var(--primary-color);
    transform: translateY(-1px);
}

.btn-logout i {
    font-size: 0.7rem;
}

/* Theme Toggle */
.theme-toggle {
    width: 100%;
}

.theme-btn {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.875rem;
}

.theme-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary-color);
}

/* Info and Warning Boxes */
.info-box, .warning-box {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin: 1.5rem 0;
    border-left: 4px solid var(--primary-color);
}

.warning-box {
    border-left-color: #f59e0b;
}

.info-box-header, .warning-box-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

.info-box-header i {
    color: var(--primary-color);
}

.warning-box-header i {
    color: #f59e0b;
}

.info-box-header h3, .warning-box-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
}

/* Tables */
table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

th, td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: var(--bg-tertiary);
    font-weight: 600;
    color: var(--text-primary);
}

tr:hover {
    background: var(--bg-tertiary);
}

/* Blockquotes */
blockquote {
    border-left: 4px solid var(--primary-color);
    background: var(--bg-tertiary);
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    font-style: italic;
    color: var(--text-secondary);
}

/* Horizontal Rule */
hr {
    border: none;
    height: 1px;
    background: var(--border-color);
    margin: 2rem 0;
}

/* Images */
img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

/* Iframes */
iframe {
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

/* Content Organization */
.content-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    margin: 1rem 0;
    box-shadow: var(--shadow-sm);
}

.content-card h2 {
    margin-top: 0;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.25rem;
}

.content-card h2 i {
    color: var(--primary-color);
    font-size: 1.125rem;
}

.content-card h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.content-card h3 i {
    color: var(--accent-color);
    font-size: 1.125rem;
}

.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
    margin: 1rem 0;
}

.content-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 0.75rem;
    transition: var(--transition);
}

.content-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.content-item h4 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
}

.content-item h4 i {
    color: var(--primary-color);
    font-size: 0.75rem;
}

.content-item p {
    margin-bottom: 0.75rem;
    line-height: 1.5;
    font-size: 0.8rem;
}

.content-item ul {
    margin: 0.75rem 0;
    font-size: 0.8rem;
}

.content-item li {
    margin-bottom: 0.25rem;
    padding-left: 0.25rem;
    font-size: 0.8rem;
}

/* Table of Contents */
.toc {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin: 0; /* Remove margin to prevent content flow issues */
    position: fixed;
    top: 6rem; /* Moved down to account for header */
    right: 2rem;
    width: 280px;
    max-height: calc(100vh - 8rem); /* Adjusted for new top position */
    overflow-y: auto;
    z-index: 1000; /* Increased z-index to appear above banner */
    box-shadow: var(--shadow-lg);
    opacity: 0; /* Start hidden */
    transform: translateX(100%); /* Start off-screen */
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Show TOC when page is loaded */
.toc.loaded {
    opacity: 1;
    transform: translateX(0);
}

.toc h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.toc h3 i {
    color: var(--primary-color);
}

.toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc li {
    margin-bottom: 0.5rem;
}

.toc a {
    display: block;
    padding: 0.5rem 0.75rem;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.toc a:hover {
    background: var(--bg-hover);
    color: var(--text-primary);
    border-left-color: var(--primary-color);
}

/* Step-by-step guides */
.steps {
    counter-reset: step-counter;
}

.step {
    counter-increment: step-counter;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    margin: 1.5rem 0;
    position: relative;
    padding-left: 4rem;
}

.step::before {
    content: counter(step-counter);
    position: absolute;
    left: 1rem;
    top: 1.5rem;
    background: var(--primary-color);
    color: white;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
}

.step h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

/* Resource links */
.resource-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.resource-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1rem;
    text-align: center;
    transition: var(--transition);
}

.resource-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-color);
}

.resource-item i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
}

.resource-item h5 {
    margin: 0 0 0.5rem 0;
    color: var(--text-primary);
    font-size: 1rem;
}

.resource-item p {
    margin: 0 0 1rem 0;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.resource-item .btn {
    width: 100%;
    justify-content: center;
}

/* Callout boxes */
.callout {
    background: var(--bg-secondary);
    border-left: 4px solid var(--primary-color);
    border-radius: 0 var(--border-radius) var(--border-radius) 0;
    padding: 1.5rem;
    margin: 2rem 0;
    position: relative;
}

.callout.warning {
    border-left-color: var(--warning-color);
    background: rgba(245, 158, 11, 0.1);
}

.callout.success {
    border-left-color: var(--success-color);
    background: rgba(16, 185, 129, 0.1);
}

.callout.info {
    border-left-color: var(--primary-color);
    background: rgba(59, 130, 246, 0.1);
}

.callout h4 {
    margin-top: 0;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.callout.warning h4 i {
    color: var(--warning-color);
}

.callout.success h4 i {
    color: var(--success-color);
}

.callout.info h4 i {
    color: var(--primary-color);
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .toc {
        display: none; /* Hide TOC on smaller screens */
    }
    
    .content-area {
        margin-right: 0; /* Remove TOC margin */
    }
}

@media (max-width: 768px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
    
    .resource-grid {
        grid-template-columns: 1fr;
    }
    
    .content-card {
        padding: 1.5rem;
        margin: 1rem 0;
    }
    
    .step {
        padding-left: 3rem;
    }
    
    .step::before {
        width: 1.5rem;
        height: 1.5rem;
        font-size: 0.75rem;
    }
}

/* Theme Toggle and Dark Mode Styles */

.theme-icon {
    position: relative;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-icon i {
    position: absolute;
    transition: var(--transition);
    font-size: 1rem;
}

.theme-icon .fa-sun {
    opacity: 1;
    transform: rotate(0deg);
}

.theme-icon .fa-moon {
    opacity: 0;
    transform: rotate(180deg);
}

[data-theme="dark"] .theme-icon .fa-sun {
    opacity: 0;
    transform: rotate(180deg);
}

[data-theme="dark"] .theme-icon .fa-moon {
    opacity: 1;
    transform: rotate(0deg);
}

/* Theme Transition Effects */
* {
    transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

/* Print styles */
@media print {
    :root {
        --bg-primary: white;
        --bg-secondary: white;
        --bg-tertiary: #f5f5f5;
        --text-primary: black;
        --text-secondary: #333;
        --text-muted: #666;
        --border-color: #ccc;
        --primary-color: #0066cc;
    }
    
    .theme-toggle {
        display: none;
    }
    
    .sidebar {
        display: none;
    }
    
    .sidebar-layout {
        grid-template-columns: 1fr;
    }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .content-header {
        padding: 1rem;
    }
    
    .content-area {
        padding: 1rem;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.5rem;
    }
}

@media (max-width: 768px) {
    .header-actions {
        display: none;
    }
    
    .breadcrumb {
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .content-area {
        padding: 0.75rem;
    }
    
    h1 {
        font-size: 1.75rem;
    }
    
    .lead {
        font-size: 1.125rem;
    }
}

/* Visual Resources Styles */
.resource-image {
    text-align: center;
    margin: 2rem 0;
}

.resource-image img {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.resource-image img:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.image-caption {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 0.5rem;
}

.video-tutorial {
    margin: 2rem 0;
}

.video-container {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    margin: 1rem 0;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-md);
}

.video-caption {
    font-size: 0.875rem;
    color: var(--text-secondary);
    font-style: italic;
    margin-top: 0.5rem;
    text-align: center;
}

/* Full Width Layout */
.full-width-layout {
    max-width: none !important;
    margin: 0 !important;
    padding: 1.5rem;
    width: 100%;
}

.full-width-layout .content-card {
    margin: 1rem 0;
    max-width: none;
}

.full-width-layout .content-grid {
    max-width: none;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

.full-width-layout .content-item {
    max-width: none;
}

.full-width-layout .content-area {
    margin-right: 0 !important;
}

/* Checklist System */
.checklist-section {
    margin: 2rem 0;
    padding: 1.5rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
}

.checklist-section h3 {
    margin-top: 0;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--primary-color);
}

.checklist-items {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.checklist-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: var(--transition);
}

.checklist-item:hover {
    background: var(--bg-hover);
    border-color: var(--primary-color);
}

.checklist-item input[type="checkbox"] {
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.125rem;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.checklist-item label {
    flex: 1;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.checklist-item label strong {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 600;
}

.checklist-item label span {
    color: var(--text-secondary);
    font-size: 0.875rem;
    line-height: 1.4;
}

.checklist-item input[type="checkbox"]:checked + label strong {
    color: var(--success-color);
    text-decoration: line-through;
}

.checklist-item input[type="checkbox"]:checked + label span {
    color: var(--text-muted);
}

/* Credits Section */
.credits-section {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin: 2rem 0;
    padding: 2rem;
    box-shadow: var(--shadow-sm);
}

.credits-content h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.credits-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0;
}

.credits-item {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
}

.credits-item h4 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.credits-item p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.credits-footer {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
}

.credits-footer p {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Responsive video adjustments */
@media (max-width: 768px) {
    .video-container {
        padding-bottom: 56.25%;
    }
    
    .resource-image {
        margin: 1rem 0;
    }
    
    .credits-details {
        grid-template-columns: 1fr;
    }
    
    .credits-section {
        padding: 1.5rem;
        margin: 1rem 0;
    }
}

@media (max-width: 480px) {
    .video-container {
        padding-bottom: 56.25%;
    }
    
    .image-caption,
    .video-caption {
        font-size: 0.75rem;
    }
    
    .credits-footer p {
        flex-direction: column;
        gap: 0.25rem;
    }
}