:root {
    /* Color Palette */
    --bg-main: #0B0F19;
    --bg-secondary: #1A1F2C;
    --bg-tertiary: #252A37;
    --text-primary: #E2E8F0;
    --text-secondary: #94A3B8;
    --accent-primary: #3B82F6;
    --accent-primary-hover: #2563EB;
    --accent-secondary: #8B5CF6;
    --border-color: #334155;
    
    /* Code Colors */
    --code-bg: #0F172A;
    --code-text: #38BDF8;
    
    /* Typography */
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'Fira Code', monospace;
    
    /* Spacing & Sizes */
    --sidebar-width: 280px;
    --header-height: 70px;
    --radius-sm: 6px;
    --radius-md: 12px;
    --radius-lg: 16px;
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: var(--font-main);
    line-height: 1.6;
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    width: 100%;
}

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

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background-color: rgba(26, 31, 44, 0.7);
    backdrop-filter: blur(12px);
    border-right: 1px solid var(--border-color);
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 24px;
    border-bottom: 1px solid var(--border-color);
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: 8px;
}

.logo h2 {
    font-size: 1.25rem;
    font-weight: 700;
    background: linear-gradient(to right, #fff, #94A3B8);
    -webkit-background-clip: text;
    color: transparent;
}

.sidebar-nav {
    padding: 24px;
}

.nav-group-title {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    font-weight: 600;
    margin-bottom: 12px;
}

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

.nav-links li {
    margin-bottom: 8px;
}

.nav-links a {
    display: block;
    padding: 8px 12px;
    color: var(--text-secondary);
    text-decoration: none;
    border-radius: var(--radius-sm);
    transition: all 0.2s ease;
    font-size: 0.95rem;
}

.nav-links a:hover {
    color: var(--text-primary);
    background-color: var(--bg-tertiary);
}

.nav-links a.active {
    color: var(--accent-primary);
    background-color: rgba(59, 130, 246, 0.1);
    font-weight: 500;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-width: 0; /* Asegura que el flex-child pueda encogerse por debajo de su tamaño natural y no expanda la pantalla */
    display: flex;
    flex-direction: column;
}

.top-bar {
    height: var(--header-height);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    background-color: rgba(11, 15, 25, 0.8);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 90;
}

.btn-buy {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    padding: 8px 16px;
    border-radius: var(--radius-md);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: opacity 0.2s ease, transform 0.2s ease;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    white-space: nowrap;
}

.btn-buy:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}

.search-bar {
    display: flex;
    align-items: center;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 20px;
    padding: 8px 16px;
    width: 300px;
    gap: 12px;
}

.search-bar svg {
    color: var(--text-secondary);
}

.search-bar input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 0.9rem;
    width: 100%;
}

.content-wrapper {
    max-width: 900px;
    width: 100%;
    margin: 0 auto;
    padding: 40px;
}

.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    margin-right: 20px;
}

/* Typography & Content Styles */
.date {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.doc-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: -0.02em;
}

.lead {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 32px;
}

.doc-section h2 {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 48px 0 24px;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 12px;
}

.doc-section h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin: 32px 0 16px;
}

.doc-section p {
    margin-bottom: 24px;
    color: #CBD5E1;
}

/* Alerts */
.alert {
    display: flex;
    gap: 16px;
    padding: 20px;
    border-radius: var(--radius-md);
    margin: 32px 0;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.alert-icon {
    font-size: 1.5rem;
}

.alert-content p {
    margin-bottom: 0;
}

.alert.warning {
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.alert.warning .alert-icon {
    font-size: 1.5rem;
}

.alert.warning .alert-content strong {
    color: #F59E0B;
}

/* Warning Alert for Endpoint Reference */
.warning-alert {
    display: flex;
    gap: 16px;
    padding: 20px;
    border-radius: var(--radius-md);
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.3);
    align-items: center;
}

.warning-alert svg {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    color: #F59E0B;
}

.warning-alert strong {
    color: #F59E0B;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    margin: 32px 0;
    -webkit-overflow-scrolling: touch;
    width: 100%;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    font-weight: 600;
    color: #fff;
    background-color: var(--bg-secondary);
}

td {
    color: #CBD5E1;
}

/* Lists */
.styled-list {
    margin-bottom: 32px;
    padding-left: 24px;
}

.styled-list li {
    margin-bottom: 12px;
    color: #CBD5E1;
}

.styled-list li strong {
    color: #fff;
}

/* Architecture Diagram */
.glass-panel {
    background: rgba(26, 31, 44, 0.5);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px;
    margin: 40px 0;
    backdrop-filter: blur(10px);
}

.architecture-diagram {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
}

@media (max-width: 768px) {
    .architecture-diagram {
        flex-direction: column;
    }
}

.arch-box {
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 24px;
    flex: 1;
    text-align: center;
}

.arch-box h3 {
    margin: 0 0 8px 0;
    font-size: 1.2rem;
}

.arch-connector {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--text-secondary);
    gap: 8px;
    font-size: 0.9rem;
}

.arch-subbox {
    background: rgba(59, 130, 246, 0.1);
    border: 1px dashed var(--accent-primary);
    padding: 16px;
    border-radius: var(--radius-sm);
    margin: 16px 0;
}

.features-list {
    list-style: none;
    text-align: left;
    padding: 0;
}

.features-list li {
    font-size: 0.9rem;
    margin-bottom: 4px;
    color: var(--text-secondary);
}

.features-list li::before {
    content: '✓';
    color: var(--accent-primary);
    margin-right: 8px;
}

/* Code Blocks */
pre {
    background: var(--code-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 16px;
    overflow-x: auto;
    margin: 24px 0;
    max-width: 100%;
}

code {
    font-family: var(--font-mono);
    color: var(--code-text);
    font-size: 0.9rem;
}

p code, li code {
    background: rgba(255, 255, 255, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    color: #38BDF8;
    word-break: break-word;
}

/* Steps */
.step-card {
    display: flex;
    gap: 24px;
    margin-bottom: 40px;
}

.step-num {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.2rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.step-content {
    flex: 1;
}

.step-content h3 {
    margin-top: 0;
}

/* Responsive */
@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .top-bar {
        padding: 0 24px;
    }
    
    .content-wrapper {
        padding: 24px;
    }
    
    .search-bar {
        width: 100%;
        max-width: 250px;
    }
}

@media (max-width: 600px) {
    .top-bar {
        padding: 0 16px;
    }
    
    .search-bar {
        display: none;
    }
    
    .btn-buy {
        font-size: 0.85rem;
        padding: 6px 12px;
    }
    
    .content-wrapper {
        padding: 16px;
    }
    
    .doc-section h1 {
        font-size: 1.8rem;
    }
    
    .doc-section h2 {
        font-size: 1.4rem;
        margin: 32px 0 16px;
    }
    
    .lead {
        font-size: 1.1rem;
        margin-bottom: 24px;
    }
    
    .step-card {
        flex-direction: column;
        gap: 16px;
    }
    
    .glass-panel {
        padding: 24px;
    }

    .warning-alert {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
}

/* Footer */
.app-footer {
    text-align: center;
    padding: 32px 24px;
    margin-top: 40px;
    border-top: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.app-footer auto {
    color: var(--text-secondary);
}

.app-footer a {
    color: var(--accent-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.app-footer a:hover {
    color: var(--accent-primary-hover);
    text-decoration: underline;
}
