:root {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border-color: #334155;
    --accent-color: #10b981;
    --accent-glow: rgba(16, 185, 129, 0.15);
    --code-bg: #090d16;
    --quote-bg: #1e293b;
    --alert-note-bg: rgba(59, 130, 246, 0.15);
    --alert-note-border: #3b82f6;
    --alert-important-bg: rgba(16, 185, 129, 0.15);
    --alert-important-border: #10b981;
    --alert-warning-bg: rgba(245, 158, 11, 0.15);
    --alert-warning-border: #f59e0b;
    --alert-tip-bg: rgba(139, 92, 246, 0.15);
    --alert-tip-border: #8b5cf6;
    --alert-caution-bg: rgba(239, 68, 68, 0.15);
    --alert-caution-border: #ef4444;
    --sidebar-glow: rgba(0, 0, 0, 0.3);
}

body.light-theme {
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --border-color: #cbd5e1;
    --accent-color: #059669;
    --accent-glow: rgba(5, 150, 105, 0.1);
    --code-bg: #f1f5f9;
    --quote-bg: #f1f5f9;
    --alert-note-bg: #eff6ff;
    --alert-note-border: #3b82f6;
    --alert-important-bg: #ecfdf5;
    --alert-important-border: #10b981;
    --alert-warning-bg: #fffbeb;
    --alert-warning-border: #f59e0b;
    --alert-tip-bg: #f5f3ff;
    --alert-tip-border: #8b5cf6;
    --alert-caution-bg: #fef2f2;
    --alert-caution-border: #ef4444;
    --sidebar-glow: rgba(0, 0, 0, 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    transition: background-color 0.3s, color 0.3s;
}

/* Sidebar Custom Scrollbar (Nicer slider) */
.sidebar::-webkit-scrollbar {
    width: 6px;
}
.sidebar::-webkit-scrollbar-track {
    background: transparent;
}
.sidebar::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}
.sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--accent-color);
}

/* Sidebar Styling (Right Aligned + Glassmorphism) */
.sidebar {
    width: 300px;
    background-color: rgba(30, 41, 59, 0.75);
    backdrop-filter: blur(16px) saturate(180%);
    -webkit-backdrop-filter: blur(16px) saturate(180%);
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    right: 0;
    top: 64px;
    height: calc(100vh - 64px);
    overflow-y: auto;
    z-index: 95;
    box-shadow: -4px 0 20px var(--sidebar-glow);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), background-color 0.3s;
}

body.light-theme .sidebar {
    background-color: rgba(255, 255, 255, 0.8);
}

.sidebar-header {
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--accent-color);
    letter-spacing: 0.5px;
}

.sidebar-subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

.nav-menu {
    padding: 16px 12px;
}

.nav-group {
    margin-bottom: 16px;
}

.nav-group-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    font-weight: 800;
    color: var(--text-secondary);
    letter-spacing: 1px;
    margin-bottom: 6px;
    padding-left: 8px;
}

.nav-item {
    display: block;
    padding: 6px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    border-radius: 6px;
    margin-bottom: 2px;
    transition: all 0.2s ease;
    border: none;
}

.nav-item:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
    transform: translateX(-2px);
}

body.light-theme .nav-item:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

.nav-item.active {
    color: var(--bg-primary);
    background-color: var(--accent-color);
    box-shadow: 0 4px 12px var(--accent-glow);
    font-weight: 600;
}

.nav-item.active:hover {
    color: var(--bg-primary);
    transform: none;
}

/* Sticky Top Navigation Bar */
.top-bar {
    height: 64px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    background-color: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background-color 0.3s, border-color 0.3s;
}

body.light-theme .top-bar {
    background-color: rgba(248, 250, 252, 0.85);
}

.logo-link {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--accent-color);
    text-decoration: none;
    border-bottom: none;
    display: flex;
    align-items: center;
    gap: 8px;
}
.logo-link:hover {
    opacity: 0.9;
}

/* Main Top Navigation */
.top-nav {
    display: flex;
    gap: 12px;
    align-items: center;
}

.top-nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 8px 16px;
    border-radius: 20px;
    transition: all 0.2s;
    border-bottom: none;
}

.top-nav-link:hover {
    color: var(--text-primary);
    background-color: rgba(255, 255, 255, 0.05);
}

body.light-theme .top-nav-link:hover {
    background-color: rgba(0, 0, 0, 0.04);
}

.top-nav-link.active {
    color: var(--accent-color);
    background-color: var(--accent-glow);
}

.controls {
    display: flex;
    align-items: center;
    gap: 12px;
}

.theme-toggle-btn {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.2s;
}

.theme-toggle-btn:hover {
    border-color: var(--accent-color);
    background-color: rgba(16, 185, 129, 0.05);
}

.menu-toggle {
    display: none;
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
}
.menu-toggle:hover {
    border-color: var(--accent-color);
}

/* Main Content Wrapper (Shifted for Right Sidebar) */
.main-wrapper {
    margin-right: 300px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 64px);
    transition: margin-right 0.3s ease;
}

.content-container {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 40px 60px 80px 60px;
}

/* Article/Document Styling */
h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    color: var(--accent-color);
    line-height: 1.25;
}

h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 2.2rem 0 1.2rem 0;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 6px;
}

h3 {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 1.6rem 0 0.8rem 0;
}

p {
    margin-bottom: 1.2rem;
    color: var(--text-primary);
}

strong {
    font-weight: 600;
    color: var(--accent-color);
}

body.light-theme strong {
    color: var(--text-primary);
}

a {
    color: var(--accent-color);
    text-decoration: none;
    border-bottom: 1px dashed var(--accent-color);
    transition: all 0.2s;
}

a:hover {
    border-bottom-style: solid;
    opacity: 0.8;
}

hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 2rem 0;
}

ul, ol {
    margin-bottom: 1.5rem;
    padding-left: 20px;
}

li {
    margin-bottom: 0.5rem;
}

blockquote {
    border-left: 4px solid var(--border-color);
    background-color: var(--quote-bg);
    padding: 14px 18px;
    border-radius: 0 8px 8px 0;
    margin-bottom: 1.5rem;
    font-style: italic;
}

.code-container {
    position: relative;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    overflow: hidden;
}

pre {
    background-color: var(--code-bg);
    padding: 16px 20px;
    overflow-x: auto;
    font-family: 'Fira Code', 'Courier New', Courier, monospace;
    font-size: 0.8rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
}

code {
    font-family: 'Fira Code', 'Courier New', Courier, monospace;
    font-size: 0.8rem;
    background-color: var(--code-bg);
    padding: 2px 6px;
    border-radius: 4px;
}

pre code {
    padding: 0;
    background: none;
}

.copy-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s;
}

.copy-btn:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}

.alert {
    padding: 14px 18px;
    border-left: 4px solid var(--border-color);
    border-radius: 0 8px 8px 0;
    margin-bottom: 1.5rem;
}

.alert-title {
    font-weight: 700;
    margin-bottom: 4px;
    font-size: 0.8rem;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.alert-note {
    background-color: var(--alert-note-bg);
    border-color: var(--alert-note-border);
}
.alert-note .alert-title { color: var(--alert-note-border); }

.alert-important {
    background-color: var(--alert-important-bg);
    border-color: var(--alert-important-border);
}
.alert-important .alert-title { color: var(--alert-important-border); }

.alert-warning {
    background-color: var(--alert-warning-bg);
    border-color: var(--alert-warning-border);
}
.alert-warning .alert-title { color: var(--alert-warning-border); }

.alert-tip {
    background-color: var(--alert-tip-bg);
    border-color: var(--alert-tip-border);
}
.alert-tip .alert-title { color: var(--alert-tip-border); }

.alert-caution {
    background-color: var(--alert-caution-bg);
    border-color: var(--alert-caution-border);
}
.alert-caution .alert-title { color: var(--alert-caution-border); }

table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
}

th, td {
    border: 1px solid var(--border-color);
    padding: 10px 14px;
    text-align: left;
}

th {
    background-color: var(--bg-secondary);
    font-weight: 600;
    color: var(--accent-color);
}

tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.01);
}

body.light-theme tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.01);
}

.task-list-item-checkbox {
    width: 14px;
    height: 14px;
    accent-color: var(--accent-color);
    vertical-align: middle;
    position: relative;
    top: -1px;
    margin-right: 8px;
}

.footer {
    border-top: 1px solid var(--border-color);
    padding: 20px 40px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-top: auto;
}

.footer a {
    color: var(--text-secondary);
    border-bottom: none;
    font-weight: 500;
}

.footer a:hover {
    color: var(--accent-color);
    opacity: 1;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background-color: var(--accent-color);
    color: var(--bg-primary) !important;
    font-weight: 700;
    padding: 12px 24px;
    border-radius: 30px;
    text-decoration: none;
    box-shadow: 0 4px 15px var(--accent-glow);
    transition: all 0.3s;
    border: none !important;
    font-size: 0.9rem;
    margin: 10px 0 20px 0;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--accent-glow);
    opacity: 0.95;
}

body.light-theme .download-btn {
    color: #ffffff !important;
}

/* Responsive Styles */
@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(100%);
        top: 64px;
        height: calc(100vh - 64px);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .main-wrapper {
        margin-right: 0;
    }
    .menu-toggle {
        display: block;
    }
    .top-bar {
        padding: 0 20px;
    }
    .top-nav {
        display: none; /* Hide top nav links on smaller screens */
    }
    .content-container {
        padding: 30px 20px;
    }
}

/* Feedback Form Styles */
.feedback-form {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 30px;
    margin-top: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}
.form-alert-info {
    background: rgba(16, 185, 129, 0.1);
    border-left: 4px solid var(--accent-color);
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 25px;
    font-size: 0.95rem;
    line-height: 1.5;
}
.form-alert-info a {
    color: var(--accent-color);
    text-decoration: underline;
}
.form-section-title {
    font-size: 1.3rem;
    margin-top: 25px;
    margin-bottom: 10px;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
}
.form-section-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 20px;
}
.form-group-title {
    font-size: 1.1rem;
    margin-top: 20px;
    margin-bottom: 15px;
    color: var(--accent-color);
}
.form-item {
    margin-bottom: 25px;
}
.form-label {
    display: block;
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 12px;
    color: var(--text-primary);
}
.rating-group {
    display: flex;
    gap: 12px;
}
.rating-option, .nps-option {
    cursor: pointer;
    position: relative;
}
.rating-option input, .nps-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.rating-option span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 600;
    transition: all 0.2s ease;
}
.rating-option input:checked + span {
    background-color: var(--accent-color);
    color: #0f172a;
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
    transform: scale(1.08);
}
.rating-option:hover span {
    border-color: var(--accent-color);
    color: var(--text-primary);
}
.nps-group {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.nps-option span {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-weight: 600;
    transition: all 0.2s ease;
}
.nps-option input:checked + span {
    background-color: var(--accent-color);
    color: #0f172a;
    border-color: var(--accent-color);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.4);
    transform: scale(1.08);
}
.nps-option:hover span {
    border-color: var(--accent-color);
    color: var(--text-primary);
}
.form-textarea {
    width: 100%;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    box-sizing: border-box;
    transition: border-color 0.2s ease;
}
.form-textarea:focus {
    outline: none;
    border-color: var(--accent-color);
    box-shadow: 0 0 0 2px rgba(16, 185, 129, 0.2);
}
.form-divider {
    border: 0;
    height: 1px;
    background: var(--border-color);
    margin: 30px 0;
}
.form-submit-container {
    display: flex;
    justify-content: flex-end;
}
.submit-form-btn {
    background-color: var(--accent-color);
    color: #0f172a;
    font-size: 1rem;
    font-weight: 600;
    padding: 12px 28px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}
.submit-form-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
}
.submit-form-btn:active {
    transform: translateY(0);
}