:root {
    /* --- GLOBAL VARIABLES --- */
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-color: #667eea;
    --bg-color: #f3f5f9;
    
    /* Dimensions */
    --header-height: 80px;
    --sidebar-width: 280px;
    --sidebar-collapsed-width: 90px;
    --docs-nav-width: 240px;
    
    /* Glassmorphism settings */
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: 1px solid rgba(255, 255, 255, 0.5);
    --soft-shadow: 0 10px 30px -10px rgba(0,0,0,0.05);
    --card-shadow: 0 10px 30px -10px rgba(0,0,0,0.05);
}

/* --- DOCS SPECIFIC LAYOUT --- */

/* Header Area */
.docs-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 3rem;
    animation: fadeInUp 0.5s ease-out;
}

.page-title {
    font-weight: 800;
    font-size: 2rem;
    color: #1a202c;
    letter-spacing: -0.5px;
    margin-bottom: 0.5rem;
}

.page-subtitle {
    color: #718096;
    font-size: 1.1rem;
    margin: 0;
}

/* Language Switcher (Top Right) */
.lang-switch-container {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 50px;
    padding: 5px 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

.lang-select {
    border: none;
    background: transparent;
    font-weight: 700;
    color: #4a5568;
    outline: none;
    cursor: pointer;
    padding: 5px;
}

/* Grid Layout for Docs */
.docs-grid {
    display: grid;
    grid-template-columns: var(--docs-nav-width) 1fr;
    gap: 3rem;
    position: relative;
}

/* --- DOCS INTERNAL NAVIGATION (Sticky) --- */
.docs-sidebar {
    position: sticky;
    top: calc(var(--header-height) + 2rem);
    height: fit-content;
    padding-right: 1rem;
    border-right: 1px dashed #e2e8f0;
}

.docs-sidebar-label {
    font-size: 0.75rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #a0aec0;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-left: 0.5rem;
    display: block;
}

.docs-nav-item {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    margin-bottom: 5px;
    border-radius: 10px;
    color: #64748b;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
    cursor: pointer;
}

.docs-nav-item:hover {
    background: rgba(102, 126, 234, 0.05);
    color: var(--primary-color);
}

.docs-nav-item.active-doc {
    background: white;
    color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border-left: 3px solid var(--primary-color);
}

.docs-nav-item i {
    margin-right: 10px;
}

/* --- DOCS CONTENT & CARDS --- */
.docs-content-area {
    min-height: 60vh;
    position: relative;
}

/* Category Title Area */
.category-info {
    margin-bottom: 3rem;
    animation: fadeInUp 0.5s ease-out;
}

.category-title {
    font-weight: 800;
    font-size: 1.75rem;
    color: #1a202c;
    margin-bottom: 0.5rem;
}

.category-description {
    color: #718096;
    font-size: 1rem;
    margin: 0;
}

/* Quick Action Cards */
.quick-cards-row {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.quick-card {
    background: white;
    border-radius: 20px;
    padding: 1.5rem;
    border: 1px solid rgba(0,0,0,0.02);
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    transition: all 0.3s;
    cursor: pointer;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

.quick-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(102, 126, 234, 0.15);
    border-color: rgba(102, 126, 234, 0.2);
}

.quick-icon {
    width: 45px;
    height: 45px;
    border-radius: 12px;
    background: #f1f5f9;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    margin-bottom: 1rem;
    transition: all 0.3s;
}

.quick-card:hover .quick-icon {
    background: var(--primary-gradient);
    color: white;
}

.quick-title {
    font-weight: 700;
    color: #2d3748;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.quick-desc {
    font-size: 0.85rem;
    color: #718096;
    margin: 0;
}

/* Documentation Sections */
.doc-section {
    background: white;
    border-radius: 24px;
    padding: 2.5rem;
    margin-bottom: 2rem;
    box-shadow: var(--card-shadow);
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

.doc-headline {
    font-weight: 800;
    font-size: 1.4rem;
    color: #1a202c;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
}

.doc-headline::before {
    content: '#';
    color: var(--primary-color);
    margin-right: 10px;
    opacity: 0.5;
}

.doc-content {
    color: #4a5568;
    line-height: 1.7;
    font-size: 0.95rem;
}

.doc-content p {
    margin-bottom: 1rem;
}

.doc-content b,
.doc-content strong {
    font-weight: 700;
    color: #2d3748;
}

.code-panel {
    background: #1e293b;
    border-radius: 16px;
    padding: 1.5rem;
    margin: 1.5rem 0;
    position: relative;
    overflow-x: auto;
}

.code-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.9);
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
}

.code-content {
    color: #e2e8f0;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.9rem;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-all;
}

.doc-image {
    width: 100%;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin-top: 1rem;
    display: block;
}

/* Loader */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(243, 245, 249, 0.9);
    backdrop-filter: blur(5px);
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    border-radius: 24px;
}

.loading-overlay.visible {
    opacity: 1;
    pointer-events: all;
}

.spinner-custom {
    width: 3rem;
    height: 3rem;
    border: 4px solid #e2e8f0;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    font-weight: 700;
    color: #718096;
    margin-top: 1rem;
}

/* Animations */
@keyframes spin {
    100% { transform: rotate(360deg); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Animation delays for staggered entry */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }
.delay-6 { animation-delay: 0.6s; }

/* Empty State */
.empty-docs {
    text-align: center;
    padding: 3rem;
    color: #718096;
}

.empty-docs i {
    font-size: 4rem;
    color: #cbd5e0;
    margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 992px) {
    .docs-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .docs-sidebar {
        display: flex;
        overflow-x: auto;
        position: relative;
        top: 0;
        border-right: none;
        border-bottom: 1px solid #e2e8f0;
        padding-bottom: 1rem;
        padding-right: 0;
    }
    
    .docs-sidebar-label {
        display: none;
    }
    
    .docs-nav-item {
        white-space: nowrap;
        margin-right: 10px;
        margin-bottom: 0;
    }
    
    .docs-header {
        flex-direction: column;
        gap: 1rem;
    }
    
    .lang-switch-container {
        align-self: flex-end;
    }
    
    .quick-cards-row {
        grid-template-columns: 1fr;
    }
    
    .doc-section {
        padding: 1.5rem;
    }
}

@media (max-width: 768px) {
    .page-title {
        font-size: 1.5rem;
    }
    
    .page-subtitle {
        font-size: 0.95rem;
    }
    
    .category-title {
        font-size: 1.35rem;
    }
    
    .doc-headline {
        font-size: 1.2rem;
    }
}