/* ===== RESET & BASE ===== */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary: #1a1a2e;
    --primary-light: #16213e;
    --accent: #e94560;
    --accent-hover: #d63851;
    --bg: #f8f9fa;
    --bg-alt: #ffffff;
    --text: #2d2d2d;
    --text-light: #6c757d;
    --text-lighter: #adb5bd;
    --border: #e9ecef;
    --shadow: 0 2px 15px rgba(0,0,0,0.08);
    --shadow-hover: 0 8px 30px rgba(0,0,0,0.12);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.3s ease;
    --sidebar-width: 260px;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--accent-hover);
}

img {
    max-width: 100%;
    height: auto;
}

/* ===== SIDEBAR ===== */
.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: var(--sidebar-width);
    background: var(--primary);
    z-index: 1000;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform var(--transition);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 28px 24px 20px;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.15rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    margin-bottom: 8px;
    flex-shrink: 0;
}

.sidebar-logo .logo-icon {
    font-size: 1.5rem;
}

.sidebar-logo .nav-badge {
    font-size: 0.6rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    background: var(--accent);
    color: #fff;
    padding: 2px 8px;
    border-radius: 20px;
    margin-left: auto;
}

.sidebar-nav {
    flex: 1;
    padding: 8px 12px;
    display: flex;
    flex-direction: column;
    gap: 1px;
}

/* Parent nav item (with or without submenu) */
.sidebar-nav > a,
.sidebar-nav .nav-parent > a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    color: rgba(255,255,255,0.6);
    font-size: 0.88rem;
    font-weight: 500;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.sidebar-nav > a .nav-icon,
.sidebar-nav .nav-parent > a .nav-icon {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.sidebar-nav > a:hover,
.sidebar-nav .nav-parent > a:hover {
    color: #fff;
    background: rgba(255,255,255,0.08);
}

.sidebar-nav > a.active,
.sidebar-nav .nav-parent > a.active {
    color: #fff;
    background: var(--accent);
    font-weight: 600;
}

/* Toggle arrow on parent items */
.nav-parent > a {
    position: relative;
}

.nav-parent > a .nav-arrow {
    margin-left: auto;
    font-size: 0.6rem;
    transition: transform var(--transition);
    opacity: 0.5;
}

.nav-parent.open > a .nav-arrow {
    transform: rotate(180deg);
}

/* Submenu */
.nav-submenu {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease;
}

.nav-parent.open > .nav-submenu {
    max-height: 600px;
}

.nav-submenu a {
    display: block;
    padding: 6px 14px 6px 48px;
    color: rgba(255,255,255,0.42);
    font-size: 0.8rem;
    font-weight: 400;
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all var(--transition);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
}

.nav-submenu a::before {
    content: '';
    position: absolute;
    left: 30px;
    top: 50%;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    transform: translateY(-50%);
    transition: background var(--transition);
}

.nav-submenu a:hover {
    color: rgba(255,255,255,0.85);
    background: rgba(255,255,255,0.05);
}

.nav-submenu a:hover::before {
    background: var(--accent);
}

.nav-submenu a.sub-active {
    color: rgba(255,255,255,0.9);
}

.nav-submenu a.sub-active::before {
    background: var(--accent);
}

.sidebar-section-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: rgba(255,255,255,0.3);
    padding: 16px 14px 6px;
    margin-top: 4px;
}

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

.sidebar-footer p {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.3);
    line-height: 1.5;
}

/* ===== MOBILE TOGGLE ===== */
.sidebar-toggle {
    display: none;
    position: fixed;
    top: 16px;
    left: 16px;
    z-index: 1001;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--primary);
    border: none;
    cursor: pointer;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}

.sidebar-toggle span {
    width: 20px;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transition: all var(--transition);
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 999;
    opacity: 0;
    transition: opacity var(--transition);
}

.sidebar-overlay.active {
    display: block;
    opacity: 1;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
}

/* ===== HERO ===== */
.hero {
    position: relative;
    padding: 100px 48px 80px;
    text-align: center;
    overflow: hidden;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 50%, #0f3460 100%);
    color: #fff;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 30% 50%, rgba(233,69,96,0.15) 0%, transparent 60%),
                radial-gradient(ellipse at 70% 50%, rgba(15,52,96,0.3) 0%, transparent 60%);
}

.hero-content {
    position: relative;
    max-width: 700px;
    margin: 0 auto;
}

.hero h1 {
    font-size: 2.6rem;
    font-weight: 800;
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: rgba(255,255,255,0.75);
    margin-bottom: 40px;
    line-height: 1.6;
}

/* ===== SEARCH ===== */
.search-box {
    position: relative;
    max-width: 500px;
    margin: 0 auto;
}

.search-box input {
    width: 100%;
    padding: 16px 24px;
    border: 2px solid rgba(255,255,255,0.2);
    border-radius: 50px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
    transition: all var(--transition);
}

.search-box input::placeholder {
    color: rgba(255,255,255,0.5);
}

.search-box input:focus {
    border-color: var(--accent);
    background: rgba(255,255,255,0.15);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 8px;
    background: #fff;
    border-radius: var(--radius);
    box-shadow: var(--shadow-hover);
    display: none;
    max-height: 400px;
    overflow-y: auto;
    z-index: 100;
}

.search-results.active {
    display: block;
}

.search-result-item {
    display: block;
    padding: 12px 20px;
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}

.search-result-item:hover {
    background: var(--bg);
}

.search-result-item:last-child {
    border-bottom: none;
}

.search-result-item .result-title {
    font-weight: 600;
    font-size: 0.9rem;
}

.search-result-item .result-section {
    font-size: 0.78rem;
    color: var(--text-light);
}

/* ===== SECTIONS ===== */
.section {
    padding: 80px 48px;
}

.section-alt {
    background: var(--bg-alt);
}

.container {
    max-width: 1100px;
    margin: 0 auto;
}

.section-title {
    font-size: 2rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 48px;
    color: var(--primary);
}

/* ===== CARDS GRID ===== */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.card {
    background: var(--bg-alt);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    text-decoration: none;
    color: var(--text);
    transition: all var(--transition);
    display: block;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-hover);
    border-color: var(--accent);
    color: var(--text);
}

.card-icon {
    font-size: 2.2rem;
    margin-bottom: 14px;
}

.card h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--primary);
}

.card p {
    font-size: 0.88rem;
    color: var(--text-light);
    line-height: 1.6;
}

/* ===== OVERVIEW GRID ===== */
.overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 32px;
}

.overview-item {
    padding: 24px;
}

.overview-item h3 {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--primary);
}

.overview-item p {
    font-size: 0.9rem;
    color: var(--text-light);
}

/* ===== PAGE CONTENT (sub-pages) ===== */
.page-header {
    padding: 80px 48px 50px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    color: #fff;
    text-align: center;
}

.page-header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 12px;
}

.page-header p {
    font-size: 1rem;
    color: rgba(255,255,255,0.7);
    max-width: 600px;
    margin: 0 auto;
}

.page-content {
    max-width: 860px;
    margin: 0 auto;
    padding: 50px 48px 100px;
}

.page-content h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--primary);
    margin-top: 56px;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border);
}

.page-content h2:first-child {
    margin-top: 0;
}

.page-content h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--primary);
    margin-top: 32px;
    margin-bottom: 12px;
}

.page-content p {
    margin-bottom: 16px;
    color: var(--text);
    font-size: 0.95rem;
}

.page-content ul, .page-content ol {
    margin-bottom: 16px;
    padding-left: 24px;
}

.page-content li {
    margin-bottom: 8px;
    font-size: 0.95rem;
    color: var(--text);
}

.page-content li strong {
    color: var(--primary);
}

/* Steps */
.steps {
    counter-reset: step;
    list-style: none;
    padding-left: 0;
}

.steps li {
    counter-increment: step;
    position: relative;
    padding-left: 48px;
    padding-bottom: 24px;
    margin-bottom: 0;
}

.steps li::before {
    content: counter(step);
    position: absolute;
    left: 0;
    top: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent);
    color: #fff;
    font-weight: 700;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.steps li::after {
    content: '';
    position: absolute;
    left: 15px;
    top: 36px;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.steps li:last-child::after {
    display: none;
}

/* Info boxes */
.info-box {
    background: #e8f4fd;
    border-left: 4px solid #2196F3;
    padding: 16px 20px;
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    margin: 20px 0;
    font-size: 0.9rem;
}

.info-box.warning {
    background: #fff8e1;
    border-left-color: #ff9800;
}

.info-box.success {
    background: #e8f5e9;
    border-left-color: #4caf50;
}

.info-box.premium {
    background: #f3e5f5;
    border-left-color: #9c27b0;
}

/* Tables */
.table-wrap {
    overflow-x: auto;
    margin: 20px 0;
}

.table-wrap table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.88rem;
}

.table-wrap th {
    background: var(--primary);
    color: #fff;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
}

.table-wrap td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
}

.table-wrap tr:hover td {
    background: var(--bg);
}

/* Breadcrumb */
.breadcrumb {
    padding: 0;
    margin: 0 0 32px;
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    font-size: 0.85rem;
}

.breadcrumb li::after {
    content: '/';
    margin-left: 8px;
    color: var(--text-lighter);
}

.breadcrumb li:last-child::after {
    display: none;
}

.breadcrumb a {
    color: var(--text-light);
}

.breadcrumb li:last-child a {
    color: var(--accent);
    font-weight: 500;
}

/* FAQ */
.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
    overflow: hidden;
}

.faq-question {
    width: 100%;
    text-align: left;
    padding: 18px 24px;
    background: var(--bg-alt);
    border: none;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    color: var(--primary);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background var(--transition);
}

.faq-question:hover {
    background: var(--bg);
}

.faq-question .arrow {
    transition: transform var(--transition);
    font-size: 0.8rem;
}

.faq-item.open .faq-question .arrow {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 24px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, padding 0.4s ease;
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.7;
}

.faq-item.open .faq-answer {
    padding: 0 24px 20px;
    max-height: 500px;
}

/* Page nav */
.page-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 60px;
    padding-top: 32px;
    border-top: 2px solid var(--border);
    gap: 16px;
}

.page-nav a {
    display: flex;
    flex-direction: column;
    padding: 16px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--text);
    transition: all var(--transition);
    max-width: 48%;
}

.page-nav a:hover {
    border-color: var(--accent);
    box-shadow: var(--shadow);
}

.page-nav a .nav-label {
    font-size: 0.78rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.page-nav a .nav-title {
    font-weight: 600;
    color: var(--primary);
}

.page-nav .next {
    text-align: right;
    margin-left: auto;
}

/* ===== FOOTER ===== */
.footer {
    background: var(--primary);
    color: rgba(255,255,255,0.7);
    padding: 60px 48px 20px;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 40px;
    max-width: 1100px;
    margin: 0 auto;
}

.footer-col h4 {
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 16px;
}

.footer-col p {
    font-size: 0.88rem;
    line-height: 1.7;
}

.footer-col ul {
    list-style: none;
}

.footer-col li {
    margin-bottom: 8px;
}

.footer-col a {
    color: rgba(255,255,255,0.6);
    font-size: 0.88rem;
    transition: color var(--transition);
}

.footer-col a:hover {
    color: #fff;
}

.footer-bottom {
    max-width: 1100px;
    margin: 40px auto 0;
    padding-top: 20px;
    border-top: 1px solid rgba(255,255,255,0.1);
    text-align: center;
    font-size: 0.82rem;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
    :root {
        --sidebar-width: 240px;
    }

    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-toggle {
        display: flex;
    }

    .main-content {
        margin-left: 0;
    }

    .hero {
        padding: 80px 24px 60px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .section {
        padding: 48px 20px;
    }

    .page-header {
        padding: 70px 24px 40px;
    }

    .page-header h1 {
        font-size: 1.8rem;
    }

    .page-content {
        padding: 40px 20px 80px;
    }

    .cards-grid {
        grid-template-columns: 1fr;
    }

    .overview-grid {
        grid-template-columns: 1fr;
    }

    .page-nav {
        flex-direction: column;
    }

    .page-nav a {
        max-width: 100%;
    }

    .footer {
        padding: 40px 20px 16px;
    }
}
