:root {
    /* Colors - Light Theme */
    --color-primary: #0070f3;
    --color-primary-hover: #0056b3;
    --color-secondary: #1e40af;
    --color-accent: #2563eb;
    
    /* Background Colors */
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --bg-card: #ffffff;
    --bg-modal: rgba(0, 0, 0, 0.4);
    
    /* Text Colors */
    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --text-inverse: #ffffff;
    
    /* Border & Shadow */
    --border-primary: #dfd4d4;
    --border-secondary: #d1d5db;
    --border-focus: var(--color-primary);
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
    --shadow-focus: 0 0 0 3px rgba(0, 112, 243, 0.1);
    
    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #0070f3, #1e40af, #2563eb);
    --gradient-button: linear-gradient(45deg, #0070f3, #1e40af);
    --gradient-text: linear-gradient(135deg, #0070f3, #1e40af, #2563eb);
    
    /* Status Colors */
    --color-success: #10b981;
    --color-warning: #f59e0b;
    --color-error: #ef4444;
    --color-info: #3b82f6;
    
    /* Spacing */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
    --space-3xl: 4rem;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-base: 0.2s ease;
    --transition-slow: 0.3s ease;
    
    /* Typography */
    --font-family: 'Space Grotesk', sans-serif;
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --font-size-3xl: 2rem;
    --font-size-4xl: 2.5rem;
    --font-size-5xl: 3rem;
    
    /* Z-Index Scale */
    --z-dropdown: 1000;
    --z-sticky: 1020;
    --z-fixed: 1030;
    --z-modal-backdrop: 1040;
    --z-modal: 1050;
    --z-popover: 1060;
    --z-tooltip: 1070;

    /* Old style variables for compatibility */
    --header-bg: #ffffff;
    --link-color: #374151;
    --gradient-bg: linear-gradient(135deg, #ffffff 0%, #f8fafc 50%, #e2e8f0 100%);
    --gradient-lower: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    --shadow-color: rgba(0, 112, 243, 0.1);
    --hover-shadow: rgba(0, 112, 243, 0.3);
    --feature-bg: #ffffff;
    --footer-bg: #f8fafc;
    --footer-border: #f8fafc;
    --glitch-color-1: #0070f3;
    --glitch-color-2: #3b82f6;
    --dot-gradient: radial-gradient(circle, rgba(0, 112, 243, 0.4), rgba(30, 64, 175, 0.2));
    --new-light-bg: #f4f7fc;
    --new-card-bg: #ffffff;
    --new-border: #e2e8f0;
    --new-text-header: #333333;
    --new-text-sub: #666666;
    --new-text-muted-light: #999999;
    --background: #ffffff;
}

/* Dark Theme Variables */
[data-theme="dark"] {
    --color-primary: #3b82f6;
    --color-primary-hover: #2563eb;
    
    --bg-primary: #000000;
    --bg-secondary: #111827;
    --bg-tertiary: #1f2937;
    --bg-card: #000000;
    --bg-modal: rgba(0, 0, 0, 0.8);
    
    --text-primary: #ffffff;
    --text-secondary: #d1d5db;
    --text-muted: #9ca3af;
    
    --border-primary: #374151;
    --border-secondary: #4b5563;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.5);
    
    --gradient-primary: linear-gradient(135deg, #ff0080, #7928ca, #0070f3);
    --gradient-button: linear-gradient(45deg, #7928ca, #ff0080);
    --gradient-text: linear-gradient(135deg, #ff0080, #7928ca, #0070f3);

    --header-bg: black;
    --link-color: rgba(255, 255, 255, 0.7);
    --gradient-bg: transparent;
    --gradient-lower: transparent;
    --shadow-color: rgba(255, 0, 128, 0.3);
    --hover-shadow: rgba(255, 0, 128, 0.3);
    --feature-bg: linear-gradient(145deg, rgba(255, 255, 255, 0.02), rgba(0, 0, 0, 0.8));
    --footer-bg: transparent;
    --footer-border: black;
    --glitch-color-1: #ff0080;
    --glitch-color-2: #00ffff;
    --dot-gradient: radial-gradient(circle, rgba(255, 0, 128, 0.6), rgba(121, 40, 202, 0.3));
    --new-light-bg: #000000;
    --new-card-bg: #2d2d2d;
    --new-border: #444444;
    --new-text-header: #ffffff;
    --new-text-sub: #cccccc;
    --new-text-muted-light: #999999;
    --background: #000000;
}

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

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

@keyframes gradient-flow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Header Styles */
#header {
    display: flex;
    flex-wrap: wrap;
    padding: 0.2rem 1.5rem 0.2rem 1rem;
    justify-content: space-between;
    align-items: center;
    background: var(--header-bg);
    transition: all 0.3s ease;
    position: sticky;
    top: 0;
    z-index: var(--z-sticky);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-primary);
}

#header #title p {
    font-family: var(--font-family);
    font-size: 32px;
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-flow 6s ease-in-out infinite;
    background-size: 400% 400%;
    margin: 0;
}

#theme-toggle {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    transition: all var(--transition-base);
}

#theme-toggle:hover {
    background: var(--bg-tertiary);
    transform: translateY(-1px);
}


/* Language Toggle Style (Similar to Theme Toggle) */
#lang-toggle {
    /* Utiliza las mismas variables de fondo, borde y color que el botón de tema */
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-primary);
    font-size: var(--font-size-sm);
    font-weight: 500; /* Hace que el texto sea un poco más legible */
    transition: all var(--transition-base);
}

#lang-toggle:hover {
    background: var(--bg-tertiary);
    /* Efecto sutil al pasar el ratón */
    transform: translateY(-1px); 
    box-shadow: var(--shadow-sm); /* Agrega una pequeña sombra para destacar */
}

/* Estilo para cuando se presiona (efecto click) */
#lang-toggle:active {
    transform: translateY(0);
    box-shadow: none;
}

/* Layout */
.docs-container {
    display: flex;
    min-height: calc(100vh - 60px);
}

/* Sidebar */
.sidebar {
    width: 260px;
    background: var(--bg-primary);
    border-right: 1px solid var(--border-primary);
    padding: 2rem 0;
    position: sticky;
    top: 60px;
    height: calc(100vh - 60px);
    overflow-y: auto;
    transition: all 0.3s ease;
}

.sidebar::-webkit-scrollbar {
    width: 6px;
}

.sidebar::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

.sidebar::-webkit-scrollbar-thumb {
    background: var(--border-secondary);
    border-radius: var(--radius-full);
}

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

.sidebar-section-title {
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    padding: 0 1.5rem;
    margin-bottom: 0.5rem;
}

.sidebar-item {
    padding: 0.5rem 1.5rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all var(--transition-fast);
    border-left: 2px solid transparent;
}

.sidebar-item:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.sidebar-item.active {
    background: var(--bg-secondary);
    color: var(--color-primary);
    border-left-color: var(--color-primary);
    font-weight: 500;
}

/* Mobile Menu Toggle */
.menu-toggle {
    display: none;
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    padding: 0.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-primary);
}

/* Main Content */
.main-content {
    flex: 1;
    padding: 3rem 4rem 3rem 14rem;
    max-width: 1350px;
    background: var(--bg-primary);
}

.loading {
    color: var(--text-muted);
    text-align: center;
    padding: 2rem;
}

.error {
    color: var(--color-error);
    background: rgba(239, 68, 68, 0.1);
    padding: 1rem;
    border-radius: var(--radius-md);
    border-left: 4px solid var(--color-error);
}

/* Markdown Rendered Content Styles */
#main-content h1 {
    font-size: var(--font-size-4xl);
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

#main-content h2 {
    font-size: var(--font-size-2xl);
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

#main-content h3 {
    font-size: var(--font-size-xl);
    font-weight: 600;
    color: var(--text-primary);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

#main-content p {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    font-size: var(--font-size-base);
}

#main-content ul,
#main-content ol {
    color: var(--text-secondary);
    margin-bottom: 1rem;
    padding-left: 2rem;
}

#main-content li {
    margin-bottom: 0.5rem;
}

#main-content code {
    background: var(--bg-secondary);
    padding: 0.2rem 0.4rem;
    border-radius: var(--radius-sm);
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--color-primary);
}

#main-content pre {
    background: #1a1a1a;
    padding: 1.5rem;
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin: 1.5rem 0;
    border: 1px solid #2d2d2d;
    position: relative;
}

[data-theme="dark"] #main-content pre {
    background: #0a0a0a;
    border: 1px solid #1a1a1a;
}

#main-content pre code {
    background: none;
    padding: 0;
    color: #e4e4e7;
    font-size: var(--font-size-sm);
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    line-height: 1.7;
}

/* Copy button for code blocks */
#main-content pre::before {
    content: '';
    position: absolute;
    top: 12px;
    right: 12px;
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23888888' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='13' height='13' rx='2' ry='2'%3E%3C/rect%3E%3Cpath d='M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1'%3E%3C/path%3E%3C/svg%3E");
    background-size: contain;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s ease;
}

#main-content pre:hover::before {
    opacity: 1;
}

.copy-button {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 6px 8px;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s ease;
    color: #888888;
    display: flex;
    align-items: center;
    justify-content: center;
}

#main-content pre:hover .copy-button {
    opacity: 1;
}

.copy-button:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    color: #ffffff;
}

.copy-button:active {
    transform: scale(0.95);
}

#main-content blockquote {
    background: var(--bg-secondary);
    border-left: 4px solid var(--color-info);
    padding: 1rem 1.5rem;
    border-radius: var(--radius-md);
    margin: 1.5rem 0;
    color: var(--text-secondary);
}

#main-content a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

#main-content a:hover {
    color: var(--color-primary-hover);
    text-decoration: underline;
}

#main-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

#main-content table th,
#main-content table td {
    padding: 0.75rem;
    border: 1px solid var(--border-primary);
    text-align: left;
}

#main-content table th {
    background: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
}

#main-content table td {
    color: var(--text-secondary);
}

#main-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    margin: 1.5rem 0;
    border: 1px solid var(--border-primary);
}

#main-content hr {
    border: none;
    border-top: 1px solid var(--border-primary);
    margin: 2rem 0;
}

/* Responsive Design */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .sidebar {
        position: fixed;
        left: -260px;
        top: 60px;
        z-index: var(--z-dropdown);
        box-shadow: var(--shadow-lg);
    }

    .sidebar.open {
        left: 0;
    }

    .main-content {
        padding: 2rem 1.5rem;
    }

    #header {
        padding: 0.5rem 1rem;
    }

    #header #title p {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 1.5rem 1rem;
    }

    #main-content h1 {
        font-size: var(--font-size-3xl);
    }

    #main-content h2 {
        font-size: var(--font-size-xl);
    }
}