/* Variables de color estilo "Modo Oscuro" de programador */
:root {
    --bg-dark: #1e1e1e;
    --bg-panel: #252526;
    --bg-hover: #2a2d2e;
    --text-main: #cccccc;
    --text-highlight: #ffffff;
    --accent: #007acc; 
    --neon-glow: #00f0ff; 
    --border-color: #333333;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow: hidden; /* Bloqueamos scroll global */
}

/* --- EFECTO SERPIENTE DE NEÓN (PREMIUM, CONTINUO Y RESPONSIVE) --- */
.neon-snake {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 99999;
    overflow: hidden;
}

.neon-snake::before {
    content: '';
    position: absolute;
    inset: -3px;
    padding: 3px;
    background-image: conic-gradient(
        from var(--angle, 0deg),
        transparent 0%,
        transparent 80%,
        #00f0ff 90%,
        #ffffff 95%,
        #00f0ff 100%
    );
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    animation: girar-neon 8s linear infinite;
    filter: drop-shadow(0 0 4px #00f0ff) drop-shadow(0 0 10px #00f0ff);
}

@property --angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

@keyframes girar-neon {
    to { --angle: 360deg; }
}

/* --- CONTENEDOR PRINCIPAL --- */
.app-container {
    display: grid;
    grid-template-columns: 250px 300px 1fr;
    height: 100vh; /* Altura forzada a la pantalla */
    overflow: hidden; 
}

/* --- ANIMACIONES DE ENSAMBLAJE --- */
@keyframes ensamblarIzquierda { 0% { transform: translateX(-150%) rotate(-10deg); opacity: 0; } 100% { transform: translateX(0) rotate(0); opacity: 1; } }
@keyframes ensamblarAbajo { 0% { transform: translateY(150%) rotate(5deg); opacity: 0; } 100% { transform: translateY(0) rotate(0); opacity: 1; } }
@keyframes ensamblarDerecha { 0% { transform: translateX(150%) rotate(10deg); opacity: 0; } 100% { transform: translateX(0) rotate(0); opacity: 1; } }

/* --- RESPONSIVIDAD --- */
@media (max-width: 900px) {
    body, .app-container { overflow-y: auto; height: auto; }
    .app-container { grid-template-columns: 1fr; }
    .sidebar, .explorer { height: auto; position: relative; border-right: none; border-bottom: 1px solid var(--border-color); animation: none; }
    .preview-panel { height: auto; position: relative; animation: none; }
    .file-list { height: auto !important; max-height: 400px; }
}

/* --- PANELES FIJOS --- */
.sidebar {
    background-color: var(--bg-dark);
    border-right: 1px solid var(--border-color);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    height: 100vh;
    position: sticky;
    top: 0;
    z-index: 10;
    animation: ensamblarIzquierda 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.avatar {
    width: 80px;
    height: 80px;
    background-color: var(--bg-panel);
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 35px;
    color: var(--accent);
    margin-bottom: 15px;
}

.profile img {
    animation: pulseGlow 3s infinite alternate;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.profile img:hover { transform: scale(1.1) rotate(3deg); border-color: #60a5fa; }

@keyframes pulseGlow {
    0% { box-shadow: 0 0 10px rgba(59, 130, 246, 0.4), 0 0 20px rgba(59, 130, 246, 0.2); }
    100% { box-shadow: 0 0 20px rgba(59, 130, 246, 0.8), 0 0 40px rgba(59, 130, 246, 0.5); }
}

.profile h2 { color: var(--text-highlight); font-size: 1.2rem; margin-bottom: 5px; }
.profile .role { color: var(--accent); font-weight: bold; font-size: 0.9rem; }
/* Corrección de la ubicación para que siempre esté en una línea */
.profile .location { 
    font-size: 0.8rem; 
    margin-top: 5px; 
    opacity: 0.7; 
    display: flex; 
    align-items: center; 
    gap: 5px; 
}
.badge { display: inline-block; background-color: var(--bg-panel); border: 1px solid var(--border-color); padding: 4px 8px; border-radius: 4px; font-size: 0.8rem; margin: 4px 2px; }

.explorer {
    background-color: var(--bg-panel);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: sticky;
    top: 0;
    z-index: 9;
    animation: ensamblarAbajo 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.explorer-header { padding: 15px 20px; text-transform: uppercase; font-size: 0.8rem; letter-spacing: 1px; border-bottom: 1px solid var(--border-color); }
.file-list { 
    list-style: none; 
    overflow-y: auto; 
    height: calc(100vh - 50px); 
}

/* Scrollbars finos para no romper la estética */
.file-list::-webkit-scrollbar, .preview-panel::-webkit-scrollbar { width: 6px; }
.file-list::-webkit-scrollbar-thumb, .preview-panel::-webkit-scrollbar-thumb { background-color: #3a3a3c; border-radius: 3px; }

.file-item { padding: 10px 20px; cursor: pointer; display: flex; align-items: center; gap: 10px; border-bottom: 1px solid rgba(255,255,255,0.02); transition: background 0.2s; font-size: 0.85rem; }
.file-item:hover { background-color: var(--bg-hover); }
.file-item.active { background-color: rgba(0, 122, 204, 0.2); border-left: 3px solid var(--accent); color: var(--text-highlight); }
.file-item i { color: #dcb67a; }

/* --- PANEL DERECHO CON SCROLL INDEPENDIENTE --- */
.preview-panel {
    background-color: var(--bg-dark);
    padding: 40px;
    height: 100vh;
    overflow-y: auto;
    position: relative;
    animation: ensamblarDerecha 1s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.welcome-screen { height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; opacity: 0.5; }
.welcome-screen i { font-size: 50px; margin-bottom: 20px; color: var(--accent); }
#welcome-screen h2 { white-space: pre-wrap; line-height: 1.6; }
.hidden { display: none; }
.project-details { max-width: 800px; margin: 0 auto; animation: slideInRight 0.4s ease-out; }
@keyframes slideInRight { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
.preview-header h1 { color: var(--text-highlight); font-size: 2.5rem; margin-bottom: 10px; }
.tech-stack { margin-bottom: 30px; display: flex; gap: 10px; flex-wrap: wrap; }
.project-img {
    display: block;
    width: auto;          
    max-width: 100%;      
    max-height: 280px;    
    margin: 0 auto 20px;  
    border-radius: 8px;
    border: 1px solid var(--border-color);
    object-fit: cover;    
}
.description-box { background-color: var(--bg-panel); padding: 25px; border-radius: 8px; margin-bottom: 30px; line-height: 1.6; }

.btn-primary { display: inline-block; background-color: var(--accent); color: white; text-decoration: none; padding: 12px 24px; border-radius: 6px; font-weight: bold; position: relative; overflow: hidden; transition: all 0.3s ease; }
.btn-primary::after { content: ''; position: absolute; top: -50%; left: -60%; width: 20%; height: 200%; background: rgba(255, 255, 255, 0.3); transform: rotate(30deg); transition: all 0.5s ease-in-out; }
.btn-primary:hover { transform: scale(1.03); box-shadow: 0 0 15px rgba(59, 130, 246, 0.5); background-color: #005999; }
.btn-primary:hover::after { left: 120%; }
.btn-primary:active { transform: scale(0.95); }

#neon-snake {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 99999;
}

/* --- CLASES NUEVAS PARA EL ACORDEÓN DESPLEGABLE --- */
.category-wrapper {
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
}

.category-header {
    padding: 15px 20px;
    color: #b3c2d4; 
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.2s, color 0.2s;
    user-select: none;
}

.category-header:hover {
    background-color: var(--bg-hover);
    color: var(--text-highlight);
}

.category-header i.folder-icon {
    margin-right: 8px;
    color: #4f46e5; 
}

.category-header i.chevron-icon {
    font-size: 0.7rem;
    transition: transform 0.3s ease;
    color: #64748b;
}

.project-sublist {
    list-style: none;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: rgba(0, 0, 0, 0.15);
}

.category-wrapper.open .project-sublist {
    max-height: 600px; 
}

.category-wrapper.open .chevron-icon {
    transform: rotate(90deg); 
}
/* Compactar el bloque Stack */
.skills {
    padding: 5px 0 !important;
}

.skill-group {
    margin-bottom: 6px !important; /* Espacio mínimo entre categorías */
}

.skill-group h4 {
    margin: 2px 0 3px 0 !important;
    font-size: 0.70rem !important; /* Fuente pequeña para ganar altura */
    color: #60a5fa !important; /* Azul suave */
    text-transform: uppercase;
}

.badge {
    padding: 2px 6px !important;
    margin: 1px !important; /* Espacio mínimo entre etiquetas */
    font-size: 0.65rem !important; /* Etiquetas más pequeñas para que quepan más */
    display: inline-block;
}
