/* ==================== 
   ROOT & GLOBAL STYLES 
   ==================== */

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

:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --accent-color: #ec4899;
    --bg-light: #f8fafc;
    --bg-white: #ffffff;
    --text-dark: #1e293b;
    --text-gray: #64748b;
    --border-color: #e2e8f0;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ==================== 
   HEADER STYLES 
   ==================== */

.header {
    background: var(--bg-white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo img {
    height: 40px;
    width: auto;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: var(--text-gray);
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    flex-direction: column;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    gap: 0.375rem;
}

.hamburger {
    width: 24px;
    height: 3px;
    background: var(--text-dark);
    border-radius: 2px;
    transition: var(--transition);
}

.menu-toggle.active .hamburger:nth-child(1) {
    transform: rotate(45deg) translate(8px, 8px);
}

.menu-toggle.active .hamburger:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .hamburger:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -7px);
}

/* ==================== 
   HERO SECTION 
   ==================== */

.hero {
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -1px;
}

.hero-subtitle {
    font-size: 1.25rem;
    font-weight: 300;
    opacity: 0.9;
}

/* ==================== 
   PRODUCTS SECTION 
   ==================== */

.products-section {
    padding: 4rem 0;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 2rem;
}

.product-card {
    background: var(--bg-white);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.card-icon {
    width: 70px;
    height: 70px;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.08);
    border-radius: 12px;
}

.card-icon svg {
    width: 100%;
    height: 100%;
    stroke-width: 1.5;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
}

.card-description {
    color: var(--text-gray);
    margin-bottom: 1rem;
    line-height: 1.6;
    flex: 1;
}

.card-features {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.feature-tag {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

/* ==================== 
   BUTTONS 
   ==================== */

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

/* ==================== 
   DOC PAGE SIDEBAR 
   ==================== */

.doc-wrapper {
    display: flex;
    min-height: calc(100vh - 80px);
}

.sidebar {
    width: 280px;
    background: var(--bg-white);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0;
    position: sticky;
    top: 70px;
    height: calc(100vh - 70px);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.03);
}

.sidebar-content {
    padding: 2.5rem 1.5rem;
}

.sidebar-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.toc-nav {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toc-link {
    color: var(--text-gray);
    text-decoration: none;
    padding: 0.7rem 1rem;
    border-radius: 6px;
    transition: var(--transition);
    font-size: 0.95rem;
    border-left: 3px solid transparent;
    display: block;
    position: relative;
    font-weight: 500;
}

.toc-link:hover {
    background: var(--bg-light);
    color: var(--primary-color);
    padding-left: 1.2rem;
}

.toc-link.active {
    background: rgba(99, 102, 241, 0.08);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 700;
    padding-left: 1.2rem;
}

/* ==================== 
   DOC CONTENT STYLES 
   ==================== */

.doc-content {
    flex: 1;
    padding: 3.5rem;
    overflow-y: auto;
    background: var(--bg-white);
}

.doc-section {
    margin-bottom: 4rem;
    scroll-margin-top: 100px;
}

.doc-section h1 {
    font-size: 3rem;
    color: var(--text-dark);
    margin-bottom: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.doc-section h2 {
    font-size: 2.2rem;
    color: var(--text-dark);
    margin-top: 3rem;
    margin-bottom: 1.5rem;
    font-weight: 700;
    position: relative;
    padding-bottom: 0.75rem;
}

.doc-section h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--accent-color));
    border-radius: 2px;
}

.doc-section h3 {
    font-size: 1.4rem;
    color: var(--text-dark);
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.doc-section h4 {
    font-size: 1.15rem;
    color: var(--text-dark);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.doc-section p {
    color: var(--text-gray);
    line-height: 1.85;
    margin-bottom: 1.25rem;
    font-size: 1.05rem;
}

.intro-text {
    font-size: 1.15rem;
    color: var(--text-dark);
    line-height: 1.9;
    margin-bottom: 2.5rem;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(236, 72, 153, 0.05) 100%);
    border-left: 5px solid var(--primary-color);
    border-radius: 8px;
    font-weight: 500;
}

.doc-section ul,
.doc-section ol {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

.doc-section li {
    color: var(--text-gray);
    margin-bottom: 0.75rem;
    line-height: 1.8;
    font-size: 1.05rem;
}

/* ==================== 
   CODE BLOCK 
   ==================== */

.code-block {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border: 1px solid rgba(226, 232, 240, 0.1);
    border-radius: 8px;
    padding: 1.5rem;
    margin: 2rem 0;
    overflow-x: auto;
    font-family: 'Fira Code', 'Source Code Pro', 'Courier New', monospace;
    font-size: 0.95rem;
    color: #e2e8f0;
    position: relative;
    box-shadow: inset 0 2px 8px rgba(0, 0, 0, 0.3);
    line-height: 1.6;
}

.code-block code {
    color: #e2e8f0;
    display: block;
    white-space: pre;
}

.code-block-copy {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: var(--transition);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.code-block-copy:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(99, 102, 241, 0.4);
}

/* ==================== 
   KEYBOARD SHORTCUTS TABLE 
   ==================== */

.shortcuts-table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    background: var(--bg-white);
}

.shortcuts-table th,
.shortcuts-table td {
    padding: 1.2rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
    font-size: 1rem;
}

.shortcuts-table th {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    font-weight: 700;
    letter-spacing: 0.5px;
}

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

.shortcuts-table tr:hover {
    background: var(--bg-light);
}

.shortcuts-table td:first-child {
    font-weight: 600;
    color: var(--text-dark);
}

/* ==================== 
   FAQ ITEMS 
   ==================== */

.faq-item {
    background: var(--bg-light);
    padding: 2rem;
    margin-bottom: 1.5rem;
    border-radius: 8px;
    border-left: 5px solid var(--primary-color);
    transition: var(--transition);
}

.faq-item:hover {
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.1);
}

.faq-item h4 {
    margin-bottom: 0.75rem;
    color: var(--text-dark);
    font-weight: 700;
}

.faq-item p {
    margin-bottom: 0;
    color: var(--text-gray);
    line-height: 1.7;
}

/* ==================== 
   FOOTER 
   ==================== */

.footer {
    background: var(--text-dark);
    color: white;
    padding: 3rem 0 1rem;
    margin-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    font-weight: 700;
}

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

.footer-section a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    display: block;
    margin-bottom: 0.5rem;
    transition: var(--transition);
}

.footer-section a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
}

/* ==================== 
   FLOATING TOC BUTTON
   ==================== */

.floating-toc-btn {
    display: none;
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: none;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    z-index: 98;
    transition: var(--transition);
    align-items: center;
    justify-content: center;
    padding: 0;
}

.floating-toc-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
    box-shadow: 0 12px 30px rgba(99, 102, 241, 0.3);
}

.floating-toc-btn svg {
    width: 24px;
    height: 24px;
}

/* ==================== 
   RESPONSIVE DESIGN 
   ==================== */

@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }

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

    .menu-toggle {
        display: flex;
    }

    .nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-white);
        flex-direction: column;
        gap: 0;
        padding: 1rem;
        border-bottom: 1px solid var(--border-color);
        max-height: 0;
        overflow: hidden;
        transition: var(--transition);
    }

    .nav.active {
        max-height: 300px;
        padding: 1rem;
    }

    .nav-link {
        padding: 0.75rem 0;
        border-bottom: 1px solid var(--border-color);
        font-size: 0.95rem;
    }

    .nav-link:last-child {
        border-bottom: none;
    }

    .nav-link.active::after {
        display: none;
    }

    .nav-link.active {
        color: var(--primary-color);
        padding-left: 1rem;
        border-left: 3px solid var(--primary-color);
    }

    .doc-wrapper {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        position: static;
        height: auto;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        display: none;
        box-shadow: none;
    }

    .sidebar.active {
        display: block;
    }

    .sidebar-content {
        padding: 1.5rem;
    }

    .toc-nav {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    .toc-link {
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        border-radius: 6px;
    }

    .doc-content {
        padding: 1.5rem 1rem;
        background: var(--bg-white);
    }

    .doc-section h1 {
        font-size: 2rem;
    }

    .doc-section h2 {
        font-size: 1.5rem;
    }

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

    .code-block {
        font-size: 0.85rem;
        padding: 1rem;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

    .floating-toc-btn {
        display: flex;
    }

    .header {
        position: relative;
    }

    .header-content {
        flex-wrap: wrap;
    }

    .logo img {
        height: 35px;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 1.5rem;
    }

    .doc-content {
        padding: 1rem;
    }

    .doc-section {
        margin-bottom: 2rem;
    }

    .doc-section h1 {
        font-size: 1.5rem;
    }

    .doc-section h2 {
        font-size: 1.25rem;
    }

    .doc-section h3 {
        font-size: 1rem;
    }

    .shortcuts-table th,
    .shortcuts-table td {
        padding: 0.75rem;
        font-size: 0.9rem;
    }

    .code-block {
        padding: 0.75rem;
        font-size: 0.8rem;
    }

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

    .nav {
        gap: 0;
    }

    .nav-link {
        font-size: 0.95rem;
    }

    .floating-toc-btn {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
    }

    .floating-toc-btn svg {
        width: 20px;
        height: 20px;
    }

    .container {
        padding: 0 15px;
    }

    .products-grid {
        gap: 1rem;
    }

    .product-card {
        padding: 1.5rem;
    }

    .card-icon {
        width: 50px;
        height: 50px;
    }

    .hero {
        padding: 2rem 0;
    }

    .products-section {
        padding: 2rem 0;
    }

    .shortcuts-table {
        font-size: 0.9rem;
    }
}
