:root {
    --bg-dark: #121212;
    --bg-panel: #1e1e1e;
    --text-main: #e0e0e0;
    --text-muted: #a0a0a0;
    --accent: #646cff;
    --border: #333;
    --method-post: #49cc90;
    --method-get: #61affe;
    --method-put: #fca130;
    --method-delete: #f93e3e;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-main);
    display: flex;
    height: 100vh;
    overflow: hidden;
}

.app-container {
    display: flex;
    width: 100%;
    height: 100vh;
}

/* ============ SIDEBAR ============ */
.sidebar {
    width: 300px;
    min-width: 300px;
    background-color: var(--bg-panel);
    border-right: 1px solid var(--border);
    padding: 20px;
    overflow-y: auto;
    transition: transform 0.3s ease;
    z-index: 100;
}

.sidebar h2 { 
    margin: 0; 
    color: white; 
    font-size: 1.5rem; 
}

.subtitle { 
    margin-top: 5px; 
    color: var(--text-muted); 
    font-size: 0.9rem; 
    margin-bottom: 20px; 
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 10px;
    margin-bottom: 5px;
    cursor: pointer;
    border-radius: 6px;
    transition: background 0.2s;
    font-size: 0.95rem;
    word-break: break-word;
}

.nav-item:hover, 
.nav-item.active {
    background-color: #2c2c2c;
    color: white;
}

.method-badge {
    font-size: 0.65rem;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: bold;
    margin-right: 10px;
    color: #121212;
    min-width: 45px;
    text-align: center;
    text-transform: uppercase;
    flex-shrink: 0;
}

.method-badge.post { background-color: var(--method-post); }
.method-badge.get { background-color: var(--method-get); }
.method-badge.put { background-color: var(--method-put); }
.method-badge.delete { background-color: var(--method-delete); color: white; }

/* ============ CONTENIDO PRINCIPAL ============ */
.content {
    flex: 1;
    padding: 40px;
    overflow-y: auto;
    overflow-x: hidden;
}

.welcome {
    max-width: 800px;
    margin: 0 auto;
}

.welcome h1 {
    font-size: 2rem;
    margin-bottom: 10px;
}

.welcome p {
    color: var(--text-muted);
    font-size: 1.1rem;
    line-height: 1.6;
}

.endpoint-container {
    max-width: 100%;
}

.endpoint-container h1 {
    font-size: 1.8rem;
    word-break: break-word;
}

.endpoint-container > p {
    color: var(--text-muted);
    line-height: 1.5;
}

.endpoint-url {
    background: #000;
    padding: 15px;
    border-radius: 8px;
    margin: 20px 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    border: 1px solid var(--border);
    font-size: 1rem;
    overflow-x: auto;
}

.endpoint-url code {
    word-break: break-all;
}

pre {
    background-color: #000;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    border: 1px solid var(--border);
    font-size: 0.85rem;
    max-width: 100%;
}

code { 
    font-family: 'Courier New', Courier, monospace; 
    color: #a5d6ff; 
    word-break: break-word;
}

/* ============ TABLAS ============ */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 25px;
}

table { 
    width: 100%; 
    border-collapse: collapse; 
    margin-top: 10px; 
    margin-bottom: 25px;
    min-width: 600px;
}

th, td { 
    border: 1px solid var(--border); 
    padding: 12px; 
    text-align: left; 
    font-size: 0.9rem;
}

th { 
    background-color: #2a2a2a; 
    color: white; 
    font-weight: 600; 
    white-space: nowrap;
}

td { 
    background-color: #1a1a1a; 
}

td code {
    word-break: keep-all;
}

h3 {
    margin-top: 30px;
    border-bottom: 1px solid var(--border);
    padding-bottom: 8px;
    color: var(--accent);
}

ol li { 
    margin-bottom: 8px; 
    line-height: 1.5; 
}

/* ============ BOTÓN HAMBURGUESA ============ */
.hamburger-btn {
    display: none;
    position: fixed;
    top: 15px;
    left: 15px;
    z-index: 200;
    background: var(--bg-panel);
    border: 1px solid var(--border);
    color: white;
    width: 44px;
    height: 44px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.5rem;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

/* ============ OVERLAY PARA MÓVIL ============ */
.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 99;
}

/* ============ MEDIA QUERIES ============ */

/* Tablets */
@media (max-width: 768px) {
    .sidebar {
        width: 280px;
        min-width: 280px;
    }
    
    .content {
        padding: 30px 20px;
    }
    
    .endpoint-container h1 {
        font-size: 1.5rem;
    }
    
    table {
        min-width: 500px;
    }
}

/* Móviles */
@media (max-width: 640px) {
    .hamburger-btn {
        display: flex;
    }
    
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        width: 85%;
        max-width: 320px;
        transform: translateX(-100%);
        box-shadow: 2px 0 10px rgba(0,0,0,0.3);
        z-index: 150;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    .content {
        padding: 20px 15px;
        padding-top: 60px; /* Espacio para el botón hamburguesa */
    }
    
    .endpoint-url {
        flex-direction: column;
        align-items: flex-start;
        font-size: 0.9rem;
    }
    
    .endpoint-container h1 {
        font-size: 1.3rem;
    }
    
    pre {
        font-size: 0.75rem;
        padding: 10px;
    }
    
    table {
        min-width: 400px;
    }
    
    th, td {
        padding: 8px 6px;
        font-size: 0.8rem;
    }
    
    .method-badge {
        font-size: 0.6rem;
        min-width: 40px;
        padding: 3px 6px;
    }
    
    .nav-item {
        padding: 14px 12px;
        font-size: 0.9rem;
    }
    
    h3 {
        font-size: 1rem;
    }
    
    ol li {
        font-size: 0.9rem;
    }
}

/* Móviles pequeños */
@media (max-width: 380px) {
    .content {
        padding: 15px 10px;
        padding-top: 55px;
    }
    
    .endpoint-container h1 {
        font-size: 1.2rem;
    }
    
    table {
        min-width: 350px;
    }
    
    th, td {
        padding: 6px 4px;
        font-size: 0.7rem;
    }
    
    pre {
        font-size: 0.7rem;
    }
}