/* CSS Custom Properties & Design Tokens */
:root {
    /* Fonts */
    --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

    /* Theme-independent Colors (Warm Notepad Gradients) */
    --gradient-orange-start: oklch(76% 0.18 68); /* Warm orange */
    --gradient-orange-end: oklch(66% 0.21 44);   /* Warm amber-coral */
    --gradient-indigo-start: oklch(58% 0.18 260); /* Deep indigo */
    --gradient-indigo-end: oklch(48% 0.19 285);   /* Purple-blue */
    
    /* Dark Theme Colors (Default) */
    --bg-color: #080b11;
    --card-bg: rgba(15, 22, 36, 0.65);
    --card-border: rgba(255, 255, 255, 0.07);
    --border-glow: rgba(251, 146, 60, 0.15); /* orange glow */
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --nav-active-bg: rgba(251, 146, 60, 0.1);
    --nav-active-text: oklch(76% 0.18 68);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --shadow-lg: 0 12px 50px rgba(0, 0, 0, 0.5);
    
    --transition-speed: 0.3s;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
}

/* Light Theme Overrides */
body.light-theme {
    --bg-color: #f6f8fb;
    --card-bg: rgba(255, 255, 255, 0.75);
    --card-border: rgba(0, 0, 0, 0.06);
    --border-glow: rgba(251, 146, 60, 0.2);
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --nav-active-bg: rgba(251, 146, 60, 0.08);
    --nav-active-text: oklch(66% 0.21 44);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 32px 0 rgba(31, 38, 135, 0.06);
    --shadow-lg: 0 12px 50px rgba(31, 38, 135, 0.1);
}

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

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color var(--transition-speed) ease, color var(--transition-speed) ease;
    min-height: 100vh;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 10px;
}
::-webkit-scrollbar-track {
    background: var(--bg-color);
}
::-webkit-scrollbar-thumb {
    background: var(--text-muted);
    border-radius: 5px;
    border: 2px solid var(--bg-color);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

/* Background Animations */
.bg-gradient {
    position: fixed;
    border-radius: 50%;
    filter: blur(140px);
    z-index: -2;
    opacity: 0.15;
    pointer-events: none;
    transition: opacity var(--transition-speed) ease;
}

body.light-theme .bg-gradient {
    opacity: 0.08;
}

.bg-gradient-1 {
    width: 600px;
    height: 600px;
    background: linear-gradient(135deg, var(--gradient-orange-start), var(--gradient-orange-end));
    top: -200px;
    right: -100px;
    animation: float-slow 20s infinite alternate;
}

.bg-gradient-2 {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, var(--gradient-indigo-start), var(--gradient-indigo-end));
    bottom: -150px;
    left: -100px;
    animation: float-slow 25s infinite alternate-reverse;
}

.bg-grid {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(to right, rgba(128, 128, 128, 0.03) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(128, 128, 128, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    z-index: -1;
    pointer-events: none;
}

/* Keyframe Animations */
@keyframes float-slow {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(40px, 60px) scale(1.1); }
}

@keyframes pulse-soft {
    0% { box-shadow: 0 0 0 0 rgba(251, 146, 60, 0.4); }
    70% { box-shadow: 0 0 0 10px rgba(251, 146, 60, 0); }
    100% { box-shadow: 0 0 0 0 rgba(251, 146, 60, 0); }
}

/* Typography Utilities */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: var(--text-primary);
}

.gradient-text {
    background: linear-gradient(135deg, var(--gradient-orange-start), var(--gradient-orange-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Header & Brand */
.app-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(8, 11, 17, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--card-border);
    transition: background-color var(--transition-speed) ease;
}

body.light-theme .app-header {
    background: rgba(246, 248, 251, 0.7);
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    outline: none;
}

.brand-logo {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-sm);
}

.brand-name {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

/* Theme Toggle Button */
.theme-toggle {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    color: var(--text-primary);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, background-color var(--transition-speed);
    box-shadow: var(--shadow-sm);
}

.theme-toggle:hover {
    transform: scale(1.05);
    background: rgba(251, 146, 60, 0.1);
}

.theme-toggle:active {
    transform: scale(0.95);
}

.theme-toggle .icon-sun {
    display: none;
    font-size: 1.2rem;
    color: #fbbf24;
}

.theme-toggle .icon-moon {
    display: block;
    font-size: 1.1rem;
    color: #6366f1;
}

body.light-theme .theme-toggle .icon-sun {
    display: block;
}

body.light-theme .theme-toggle .icon-moon {
    display: none;
}

/* Main Container */
.main-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem 5rem 2rem;
}

/* Hero Section */
.hero-section {
    text-align: center;
    margin-bottom: 4rem;
    animation: fade-in-up 0.8s ease-out;
}

.hero-title {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    letter-spacing: -0.04em;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(251, 146, 60, 0.1);
    color: oklch(76% 0.18 68);
    padding: 0.5rem 1.25rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    border: 1px solid rgba(251, 146, 60, 0.2);
    box-shadow: 0 4px 15px rgba(251, 146, 60, 0.05);
}

body.light-theme .hero-badge {
    background: rgba(251, 146, 60, 0.08);
    color: oklch(66% 0.21 44);
    border: 1px solid rgba(251, 146, 60, 0.15);
}

/* Layout Grid */
.layout-grid {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 3rem;
    align-items: start;
}

/* Sidebar Navigation */
.sidebar-nav {
    position: sticky;
    top: 90px;
    animation: fade-in-left 0.8s ease-out;
}

.nav-links-wrapper {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
}

.nav-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.8rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.03);
    padding-left: 1.2rem;
}

body.light-theme .nav-link:hover {
    background: rgba(0, 0, 0, 0.02);
}

.nav-link.active {
    background: var(--nav-active-bg);
    color: var(--nav-active-text);
    border-left-color: oklch(76% 0.18 68);
    font-weight: 600;
    padding-left: 1.2rem;
}

/* Document Card (Glassmorphism) */
.doc-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    padding: 3rem;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow-md);
    animation: fade-in-up 0.8s ease-out;
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.doc-card:hover {
    box-shadow: var(--shadow-lg), 0 0 30px var(--border-glow);
    border-color: rgba(251, 146, 60, 0.15);
}

.doc-section {
    padding-bottom: 2.5rem;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--card-border);
}

.doc-section:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.doc-section h2 {
    font-size: 1.75rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.doc-section p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: 1.05rem;
}

.doc-section p strong {
    color: var(--text-primary);
}

.doc-section ul {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-secondary);
}

.doc-section li {
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
}

/* Highlight Box */
.highlight-box {
    background: linear-gradient(135deg, rgba(251, 146, 60, 0.08), rgba(251, 146, 60, 0.02));
    border: 1px dashed rgba(251, 146, 60, 0.3);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
}

.highlight-icon {
    font-size: 1.75rem;
    color: oklch(76% 0.18 68);
    margin-top: 0.1rem;
}

/* Permission List */
.permission-list {
    list-style: none !important;
    margin-left: 0 !important;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 1.5rem;
}

.permission-list li {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    padding: 1.25rem;
    border-radius: var(--radius-md);
    transition: transform 0.2s ease, background-color 0.2s ease;
}

body.light-theme .permission-list li {
    background: rgba(0, 0, 0, 0.01);
}

.permission-list li:hover {
    transform: translateY(-2px);
    background: rgba(251, 146, 60, 0.03);
}

.permission-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--text-primary);
}

.permission-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(251, 146, 60, 0.15);
    color: oklch(76% 0.18 68);
    font-size: 0.95rem;
}

.permission-desc {
    font-size: 0.95rem !important;
    color: var(--text-secondary);
    margin-bottom: 0 !important;
}

/* Contact Card */
.contact-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    margin-top: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

body.light-theme .contact-card {
    background: rgba(0, 0, 0, 0.01);
}

.contact-card p {
    margin-bottom: 0 !important;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.05rem;
}

.contact-icon {
    font-size: 1.25rem;
    color: oklch(76% 0.18 68);
    width: 20px;
    text-align: center;
}

.contact-card a {
    color: oklch(76% 0.18 68);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.2s;
}

.contact-card a:hover {
    text-decoration: underline;
    opacity: 0.85;
}

body.light-theme .contact-card a {
    color: oklch(66% 0.21 44);
}

/* Footer */
.app-footer {
    border-top: 1px solid var(--card-border);
    padding: 3rem 2rem;
    text-align: center;
    background: rgba(8, 11, 17, 0.4);
    transition: background-color var(--transition-speed) ease;
}

body.light-theme .app-footer {
    background: rgba(246, 248, 251, 0.4);
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-links a {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: oklch(76% 0.18 68);
}

/* Scroll Animations CSS */
@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fade-in-left {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive Styles */
@media (max-width: 992px) {
    .layout-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .sidebar-nav {
        position: static;
        width: 100%;
    }
    
    .nav-list {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .nav-link {
        padding: 0.6rem 0.9rem;
        font-size: 0.9rem;
        border-left: none;
        border-bottom: 2px solid transparent;
    }
    
    .nav-link.active {
        border-left-color: transparent;
        border-bottom-color: oklch(76% 0.18 68);
        padding-left: 0.9rem;
    }
}

@media (max-width: 768px) {
    .main-container {
        padding: 2rem 1rem 3rem 1rem;
    }
    
    .hero-title {
        font-size: 2.25rem;
    }
    
    .doc-card {
        padding: 1.75rem;
    }
    
    .doc-section h2 {
        font-size: 1.4rem;
    }
    
    .highlight-box {
        flex-direction: column;
        gap: 0.75rem;
    }
}
