@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #005fc0;
    --primary-light: #00e5ff;
    --primary-dark: #003a8c;
    --secondary: #001f3f;
    --bg-main: #f8fafc;
    --bg-sidebar: #ffffff;
    --bg-card: #ffffff;
    --text-main: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --glass: rgba(0, 95, 192, 0.03);
    --code-bg: #f1f5f9;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --sidebar-width: 280px;
}

body.dark-theme {
    --bg-main: #0f172a;
    --bg-sidebar: #1e293b;
    --bg-card: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #cbd5e1;
    --border: #334155;
    --glass: rgba(255, 255, 255, 0.05);
    --code-bg: #0f172a;
}

/* Base Styles (MOBILE FIRST) */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }

html, body {
    width: 100%;
    min-height: 100vh;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
}

.app-container {
    width: 100%;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    display: flex;
}

/* Mobile Top Elements */
.mobile-nav-toggle, .theme-header-trigger {
    position: fixed;
    top: 1rem;
    z-index: 6000;
}

.mobile-nav-toggle {
    right: 1rem;
    display: flex;
    width: 44px;
    height: 44px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 95, 192, 0.3);
}

.theme-header-trigger {
    right: 4.5rem;
}

#theme-btn {
    width: 44px; height: 44px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; color: var(--text-main);
    transition: transform 0.2s ease;
}

#theme-btn:hover { transform: scale(1.1); }
#theme-text { display: none; }

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    padding: 2rem 1.25rem;
    overflow-y: auto;
    z-index: 5000;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.sidebar.active {
    transform: translateX(0);
    box-shadow: 20px 0 50px rgba(0,0,0,0.2);
}

.logo-container { margin-bottom: 2rem; padding: 0 0.5rem; }
.logo-container a { text-decoration: none; }
.logo-img { max-width: 100%; height: auto; }

/* Sidebar Nav */
.search-container { margin-bottom: 2rem; }
#search-input {
    width: 100%; padding: 0.8rem 1rem;
    background: var(--bg-main); border: 1px solid var(--border);
    border-radius: 0.75rem; color: var(--text-main); outline: none;
    transition: border-color 0.2s ease;
}
#search-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 95, 192, 0.1);
}
.search-results-info {
    margin-top: 0.75rem;
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 0.25rem;
}
.search-clear-btn {
    background: transparent;
    border: none;
    color: var(--primary);
    font-size: 0.75rem;
    cursor: pointer;
    padding: 0.15rem 0.5rem;
    border-radius: 0.25rem;
    transition: background 0.2s ease;
}
.search-clear-btn:hover {
    background: var(--glass);
}
body.dark-theme .search-clear-btn {
    color: #60a5fa;
}
.nav-section.hidden-category {
    display: none;
}

.nav-section { margin-bottom: 2rem; }
.nav-title { font-size: 0.75rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; margin-bottom: 0.75rem; letter-spacing: 0.05em; }
body.dark-theme .nav-title { color: #94a3b8; }
.nav-list { list-style: none; padding: 0; margin: 0; }
.nav-item { margin: 0; padding: 0; }
.nav-link { 
    display: flex; align-items: center; gap: 0.75rem; padding: 0.85rem 1rem; 
    color: var(--text-muted); text-decoration: none; border-radius: 0.75rem; 
    font-size: 0.9rem; transition: all 0.2s ease;
}
.nav-link.active, .nav-link:hover { background: var(--glass); color: var(--primary); font-weight: 600; }
body.dark-theme .nav-link { color: #cbd5e1; }
body.dark-theme .nav-link.active, body.dark-theme .nav-link:hover { color: #60a5fa; background: rgba(96, 165, 250, 0.1); }

/* Search Highlight */
.search-highlight {
    background: rgba(0, 95, 192, 0.2);
    color: var(--primary-dark);
    font-weight: 600;
    padding: 0 2px;
    border-radius: 2px;
}
body.dark-theme .search-highlight {
    background: rgba(96, 165, 250, 0.3);
    color: #93c5fd;
}

/* Main Content (Mobile) */
.main-content {
    width: 100%;
    min-height: 100vh;
    padding: 5rem 1.25rem 3rem;
    overflow-x: hidden;
    flex: 1;
}

.hero { padding: 1.5rem 0 3.5rem; margin-bottom: 3rem; border-bottom: 1px solid var(--border); }
.hero h1 { 
    font-size: 2.1rem; font-weight: 900; line-height: 1.1; margin-bottom: 1.5rem; 
    color: var(--secondary); overflow-wrap: break-word;
}
.hero p { font-size: 1.15rem; color: var(--text-muted); }

.doc-section { padding: 3.5rem 0; border-bottom: 1px solid var(--border); }
.doc-section:first-child { padding-top: 0; }
.doc-section h2 { font-size: 1.75rem; margin-bottom: 1.5rem; color: var(--secondary); font-weight: 800; overflow-wrap: break-word; border-left: 4px solid var(--primary); padding-left: 1rem;}
.doc-section h3 { font-size: 1.4rem; margin: 2.5rem 0 1rem; color: var(--primary); font-weight: 700; }
.doc-section p { margin-bottom: 1.25rem; color: var(--text-muted); font-size: 1.05rem; }
.doc-section img { max-width: 100%; height: auto; border-radius: 0.5rem; margin: 1.5rem 0; }
.doc-section figure { margin: 1.5rem 0; }
.doc-section figure img { margin: 0; }
.doc-section figcaption { text-align: center; color: var(--text-muted); font-size: 0.9rem; margin-top: 0.5rem; }

.feature-img { 
    width: 100%; max-width: 100%; height: auto; border-radius: 1.25rem; 
    margin: 2rem 0; box-shadow: var(--shadow); border: 1px solid var(--border);
}

/* Cards & Content Blocks */
.card-grid { display: grid; grid-template-columns: 1fr; gap: 1.5rem; margin: 2rem 0; }
.info-card { background: var(--bg-card); padding: 2rem; border-radius: 1.5rem; border: 1px solid var(--border); box-shadow: var(--shadow); position: relative;}

.step-badge {
    position: absolute; top: -12px; left: 20px;
    background: var(--primary); color: white; padding: 4px 12px; border-radius: 50px;
    font-size: 0.65rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.05em;
}

.tip {
    background: rgba(0, 95, 192, 0.05); border-radius: 1rem; padding: 1.5rem;
    margin: 2.5rem 0; font-size: 0.95rem; color: var(--text-muted); border-left: 4px solid var(--primary);
}
.tip strong { color: var(--primary); display: block; margin-bottom: 0.5rem; text-transform: uppercase; font-size: 0.75rem; letter-spacing: 0.05em;}

.tip.warning { background: rgba(225, 29, 72, 0.05); border-left-color: #e11d48; }
.tip.warning strong { color: #e11d48; }

pre { 
    background: #1e293b; padding: 1.5rem; border-radius: 0.75rem; 
    overflow-x: auto; margin: 2rem 0; color: #f8fafc; max-width: 100%;
}
code { font-family: 'Fira Code', monospace; font-size: 0.9em; color: var(--primary); background: var(--code-bg); padding: 0.15rem 0.4rem; border-radius: 4px; }

.main-content ul { margin: 1.5rem 0 1.5rem 1.5rem; list-style: disc; }
.main-content li { margin-bottom: 0.8rem; color: var(--text-muted); padding-left: 0.5rem; }

/* Desktop Overrides */
@media (min-width: 1025px) {
    .mobile-nav-toggle { display: none; }
    .sidebar { transform: translateX(0); z-index: 1000; }
    .theme-header-trigger { right: 3rem; top: 2rem; }
    .app-container { display: flex; }
    
    .main-content {
        margin-left: var(--sidebar-width);
        padding: 5rem 8rem;
        width: calc(100% - var(--sidebar-width));
        max-width: 1400px;
        min-height: 100vh;
    }
    
    .hero { padding: 3rem 0 5rem; margin-bottom: 5rem; }
    .hero h1 { font-size: 4rem; margin-bottom: 2rem; }
    .hero p { font-size: 1.35rem; max-width: 750px; }
    
    .doc-section h2 { font-size: 2.5rem; margin-bottom: 2rem; padding-left: 2rem;}
    .doc-section h3 { font-size: 1.8rem; margin-top: 4rem; }
    
    .card-grid { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 2.5rem; }
    .info-card { padding: 3rem; }
    .tip { padding: 2.5rem; }
    
    .feature-img { margin: 4rem 0; border-radius: 2rem; }
}

@media (min-width: 1600px) {
    .main-content { padding: 5rem 15rem; }
}
