/* 
 * xLifestealCore Premium Documentation Styles
 * -------------------------------------------
 * This CSS follows modern design principles:
 * - HSL-based color system
 * - CSS Variables for easy themeing
 * - Glassmorphism effects
 * - Responsive Grid & Flexbox
 */

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

:root {
    /* Colors - Dark Theme (Default) */
    --primary: hsl(281, 98%, 58%);
    --primary-rgb: 255, 77, 77;
    --primary-dark: #ba44ff;
    --bg-main: #0a0a0c;
    --bg-sidebar: #111114;
    --bg-card: rgba(255, 255, 255, 0.03);
    --border: rgba(255, 255, 255, 0.08);
    --text-main: #e0e0e6;
    --text-muted: #a0a0ab;
    --text-inv: #111114;
    --code-bg: #16161a;
    --nav-active: rgba(172, 77, 255, 0.1);

    /* Layout Constants */
    --sidebar-width: 280px;
    --header-height: 72px;
    --content-max-width: 900px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="light"] {
    --bg-main: #f8f9fa;
    --bg-sidebar: #ffffff;
    --bg-card: rgba(0, 0, 0, 0.02);
    --border: rgba(0, 0, 0, 0.08);
    --text-main: #1a1a1e;
    --text-muted: #66666e;
    --text-inv: #ffffff;
    --code-bg: #f1f3f5;
    --nav-active: rgba(190, 77, 255, 0.05);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Layout */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    height: 100vh;
    background-color: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    position: sticky;
    top: 0;
    padding: 2rem 1.5rem;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    z-index: 100;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 2.5rem;
    text-decoration: none;
    color: var(--text-main);
}

.logo-heart {
    color: var(--primary);
    filter: drop-shadow(0 0 8px rgba(var(--primary-rgb), 0.4));
}

.sidebar-logo h1 {
    font-size: 1.25rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.nav-group {
    margin-bottom: 1.5rem;
}

.nav-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    font-weight: 700;
    margin-bottom: 0.75rem;
    padding-left: 0.75rem;
}

.nav-links {
    list-style: none;
}

.nav-links a {
    display: block;
    padding: 0.6rem 0.75rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    border-radius: 8px;
    transition: var(--transition);
    margin-bottom: 2px;
}

.nav-links a:hover {
    color: var(--text-main);
    background-color: var(--nav-active);
}

.nav-links a.active {
    color: var(--primary);
    background-color: var(--nav-active);
    font-weight: 600;
}

/* Main Content */
.main-wrapper {
    flex: 1;
    min-width: 0;
    /* Prevents overflow in flex items */
}

header {
    height: var(--header-height);
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 1.5rem;
    position: sticky;
    top: 0;
    background: rgba(var(--primary-rgb), 0.01);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
    z-index: 90;
}

.search-container {
    position: relative;
    max-width: 320px;
    width: 100%;
}

.search-container input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 0.5rem 1rem 0.5rem 2.5rem;
    border-radius: 20px;
    color: var(--text-main);
    font-family: inherit;
    transition: var(--transition);
}

.search-container input:focus {
    outline: none;
    border-color: var(--primary);
    background: var(--bg-sidebar);
}

.search-icon {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
}

.theme-toggle {
    background: none;
    border: 1px solid var(--border);
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-main);
    cursor: pointer;
    transition: var(--transition);
}

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

.content {
    max-width: var(--content-max-width);
    margin: 0 auto;
    padding: 4rem 2rem;
}

/* Hero Section */
.hero {
    text-align: center;
    padding-bottom: 4rem;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4rem;
}

.hero-banner-wrapper {
    width: 100%;
    margin-bottom: 2rem;
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), 0 0 20px rgba(var(--primary-rgb), 0.1);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.hero-banner-wrapper:hover {
    transform: scale(1.01) translateY(-5px);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6), 0 0 30px rgba(var(--primary-rgb), 0.2);
    border-color: var(--primary);
}

.hero-banner {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

.badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--nav-active);
    color: var(--primary);
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(var(--primary-rgb), 0.2);
}

.hero h2 {
    font-size: 3.5rem;
    font-weight: 800;
    letter-spacing: -2px;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--text-main) 30%, var(--primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto 2.5rem;
}

.hero-btns {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    text-decoration: none;
    transition: var(--transition);
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 10px 20px -5px rgba(var(--primary-rgb), 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 25px -5px rgba(var(--primary-rgb), 0.5);
}

.btn-secondary {
    background: var(--bg-card);
    color: var(--text-main);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: var(--border);
}

/* Section Common */
section {
    margin-bottom: 5rem;
    scroll-margin-top: calc(var(--header-height) + 2rem);
}

section h3 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

section h3::before {
    content: '';
    width: 4px;
    height: 1.5rem;
    background: var(--primary);
    border-radius: 4px;
}

/* Features Grid */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 2rem;
    border-radius: var(--radius-lg);
    transition: var(--transition);
    height: 100%;
}

.feature-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    background: rgba(255, 255, 255, 0.05);
}

.feature-icon {
    width: 48px;
    height: 48px;
    background: var(--nav-active);
    color: var(--primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.feature-card h4 {
    margin-bottom: 0.75rem;
    font-size: 1.2rem;
}

.feature-card p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Code Blocks */
.code-wrapper {
    position: relative;
    margin: 1.5rem 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    background: var(--code-bg);
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    font-size: 0.75rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
}

.copy-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 4px;
}

.copy-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.1);
}

pre {
    padding: 1.5rem;
    overflow-x: auto;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.9rem;
}

code {
    color: var(--text-main);
}

/* Tables */
.table-container {
    width: 100%;
    overflow-x: auto;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
}

table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

th {
    background: var(--bg-card);
    padding: 1rem;
    border-bottom: 1px solid var(--border);
    font-weight: 600;
    color: var(--text-muted);
}

td {
    padding: 1rem;
    border-bottom: 1px solid var(--border);
}

tr:last-child td {
    border-bottom: none;
}

.cmd-badge {
    background: var(--code-bg);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: var(--primary);
}

.perm-badge {
    background: rgba(var(--primary-rgb), 0.1);
    color: var(--primary);
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
}

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

.faq-question {
    padding: 1.25rem;
    background: var(--bg-card);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    transition: var(--transition);
}

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

.faq-answer {
    padding: 0 1.25rem;
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0, 1, 0, 1);
    background: transparent;
}

.faq-item.active .faq-answer {
    max-height: 1000px;
    padding: 1.25rem;
    transition: all 0.4s cubic-bezier(1, 0, 1, 0);
}

.faq-icon {
    transition: var(--transition);
}

.faq-item.active .faq-icon {
    transform: rotate(180deg);
}

/* Footer */
footer {
    padding: 4rem 2rem;
    border-top: 1px solid var(--border);
    margin-top: 4rem;
    text-align: center;
}

.footer-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 1.5rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-bottom: 1.5rem;
}

.footer-links a {
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    transition: var(--transition);
}

.footer-links a:hover {
    color: var(--primary);
}

.copyright {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Scroll Progress Bar */
.scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(to right, var(--primary), #ff00ff);
    z-index: 1000;
    width: 0%;
}

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 44px;
    height: 44px;
    background: var(--primary);
    color: white;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    box-shadow: 0 10px 20px rgba(var(--primary-rgb), 0.3);
    z-index: 95;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    transform: translateY(-5px);
}

/* Responsive */
@media (max-width: 1024px) {
    :root {
        --sidebar-width: 240px;
    }
}

@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -100%;
        transition: left 0.3s ease;
    }

    .sidebar.open {
        left: 0;
    }

    .mobile-menu-btn {
        display: flex !important;
    }

    header {
        justify-content: space-between;
    }

    .hero h2 {
        font-size: 2.5rem;
    }
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.reveal {
    animation: fadeIn 0.8s ease-out forwards;
}

/* Custom Model Data Section Styles */
.config-preview {
    background: #1e1e24;
    border-radius: 10px;
    padding: 1rem;
    border-left: 4px solid var(--primary);
    margin: 1rem 0;
}

.config-preview span {
    display: block;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
}

.yaml-key {
    color: #f07178;
}

.yaml-val {
    color: #c3e88d;
}

.yaml-cmt {
    color: #546e7a;
}