:root {
    /* Paleta Dark Mode Corporativa */
    --bg-body: #0a0a0a;       
    --bg-surface: #141414;    
    --primary: #3b82f6;       
    --primary-glow: rgba(59, 130, 246, 0.5);
    --text-main: #ffffff;
    --text-muted: #a3a3a3;
    --border: #333333;
}

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

/* Nuevo: Scroll fluido nativo */
html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    /* Eliminamos overflow:hidden para permitir el scroll natural hacia abajo */
    position: relative;
    overflow-x: hidden;
}

/* --- FONDO IMAGEN ESTÁTICA --- */
body::before {
    content: ''; position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -2;
    background: linear-gradient(rgba(5, 5, 5, 0.90), rgba(10, 10, 10, 0.85)), 
                url('https://rromxmhmadwtshughttz.supabase.co/storage/v1/object/public/project-images/FONDODESPUX.jpg');
    background-size: cover; background-position: center center; background-repeat: no-repeat;
}

/* --- CANVAS ANIMADO --- */
#canvas-network {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: -1; pointer-events: none;
}

/* --- HEADER Y NAVEGACIÓN --- */
header {
    padding: 20px 40px; display: flex; justify-content: space-between; align-items: center;
    border-bottom: 1px solid rgba(255,255,255,0.1); background: rgba(10, 10, 10, 0.85); 
    backdrop-filter: blur(15px); 
    position: sticky; top: 0; left: 0; z-index: 100; width: 100%;
}

.header-left { display: flex; align-items: center; }
.brand { font-size: 1.5rem; font-weight: 800; letter-spacing: 2px; text-transform: uppercase; color: var(--text-main); cursor: pointer; text-decoration: none; }
.brand span { color: var(--primary); }

.header-right { display: flex; align-items: center; gap: 20px; }
.lang-selector { display: flex; gap: 10px; padding-left: 20px; border-left: 1px solid rgba(255,255,255,0.1); }
.lang-btn { background: none; border: 2px solid transparent; cursor: pointer; padding: 0; border-radius: 50%; width: 28px; height: 28px; overflow: hidden; opacity: 0.6; transition: all 0.3s; display: flex; align-items: center; justify-content: center; }
.lang-btn img { width: 100%; height: 100%; object-fit: cover; }
.lang-btn:hover, .lang-btn.active { opacity: 1; border-color: var(--primary); transform: scale(1.1); box-shadow: 0 0 10px var(--primary-glow); }

nav { position: relative; display: flex; align-items: center; gap: 15px; }
details { position: relative; }
summary, .nav-btn { list-style: none; cursor: pointer; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: var(--text-main); padding: 10px; transition: color 0.3s; display: flex; align-items: center; gap: 5px; background: none; border: none; font-family: inherit; font-size: 1rem; text-decoration: none; }
summary::-webkit-details-marker { display: none; }
summary:hover, .nav-btn:hover, .nav-btn.active-link { color: var(--primary); }
summary::after { content: '▾'; font-size: 0.8em; }

.dropdown-menu { position: absolute; top: 100%; right: 0; margin-top: 10px; background-color: rgba(20, 20, 20, 0.95); backdrop-filter: blur(10px); border: 1px solid var(--border); border-radius: 4px; min-width: 220px; box-shadow: 0 10px 30px rgba(0,0,0,0.5); padding: 5px 0; z-index: 200; animation: fadeIn 0.2s ease-out; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }
.dropdown-menu a { display: block; padding: 12px 20px; color: var(--text-muted); text-decoration: none; font-size: 0.95rem; border-left: 2px solid transparent; transition: all 0.2s; }
.dropdown-menu a:hover { background-color: rgba(255, 255, 255, 0.05); color: white; border-left-color: var(--primary); }

/* --- CONTENIDO PÚBLICO (Scroll Vertical) --- */
#public-views {
    display: flex;
    flex-direction: column;
    width: 100%;
}

/* --- HERO SECTION --- */
.hero { display: flex; flex-direction: column; justify-content: center; align-items: center; text-align: center; padding: 120px 20px 60px; background: transparent; position: relative; z-index: 1; min-height: 80vh; }
.hero h1 { font-size: 3.5rem; font-weight: 700; margin-bottom: 20px; line-height: 1.1; max-width: 800px; text-shadow: 0 2px 10px rgba(0,0,0,0.5); }
.hero p { font-size: 1.2rem; color: var(--text-muted); max-width: 600px; margin-bottom: 50px; text-shadow: 0 1px 5px rgba(0,0,0,0.5); }

.btn-download {
    display: inline-block;
    background: linear-gradient(135deg, var(--primary) 0%, #1d4ed8 100%);
    color: white;
    padding: 15px 35px;
    border-radius: 50px;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 0.9rem;
    box-shadow: 0 10px 20px rgba(59, 130, 246, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    margin-top: -20px; /* Ajuste para compensar el margen inferior de p */
    position: relative;
    z-index: 10;
}

.btn-download:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 15px 30px rgba(59, 130, 246, 0.5);
    filter: brightness(1.1);
}

.btn-download:active {
    transform: translateY(-1px);
}

/* --- WORKS / PORTFOLIO SECTION --- */
#works-section { padding: 80px 40px; border-top: 1px solid rgba(255,255,255,0.05); }
.section-title { text-align: center; font-size: 2.5rem; margin-bottom: 60px; text-transform: uppercase; letter-spacing: 2px; }
.works-wrapper { max-width: 1200px; margin: 0 auto; display: flex; flex-direction: column; gap: 80px; align-items: center; }
.project-card { background: rgba(20, 20, 20, 0.8); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; display: grid; grid-template-columns: 1.2fr 0.8fr; box-shadow: 0 20px 50px rgba(0,0,0,0.5); backdrop-filter: blur(5px); max-width: 1000px; width: 100%; }
.project-image { width: 100%; height: 100%; min-height: 400px; background-color: #000; position: relative; overflow: hidden; }
.project-image img { width: 100%; height: 100%; object-fit: cover; background-color: #1a1a1a; transition: transform 0.5s; }
.project-image:hover img { transform: scale(1.03); }
.project-info { padding: 40px; display: flex; flex-direction: column; justify-content: center; }
.project-tag { color: var(--primary); font-size: 0.85rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; margin-bottom: 10px; }
.project-title { font-size: 2rem; margin-bottom: 20px; line-height: 1.2; }
.project-desc { color: var(--text-muted); margin-bottom: 30px; font-size: 1rem; }
.btn-project { display: inline-block; text-decoration: none; color: white; background: transparent; border: 1px solid var(--primary); padding: 10px 25px; text-align: center; border-radius: 4px; transition: all 0.3s; align-self: flex-start; cursor: pointer; font-family: inherit; font-size: 1rem; }
.btn-project:hover { background: var(--primary); box-shadow: 0 0 15px var(--primary-glow); }

/* --- VIDEOS SECTION --- */
#videos-section {
    padding: 80px 40px;
    background-color: rgba(10, 10, 10, 0.7);
    border-top: 1px solid rgba(255,255,255,0.05);
}

.carousel-container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
    position: relative;
    display: flex;
    align-items: center;
}

.carousel-wrapper {
    display: flex;
    width: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    gap: 30px;
    padding: 20px 0;
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}

.carousel-wrapper::-webkit-scrollbar {
    display: none; /* Chrome, Safari and Opera */
}

.video-card {
    flex: 0 0 calc(33.333% - 20px);
    scroll-snap-align: center;
    border-radius: 8px;
    overflow: hidden;
    background: #000;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    border: 1px solid var(--border);
    transition: transform 0.3s;
    aspect-ratio: 16 / 9;
}

.video-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 15px 40px rgba(59, 130, 246, 0.2);
}

.video-card iframe {
    width: 100%;
    height: 100%;
    pointer-events: auto;
}

.carousel-btn {
    background: rgba(20, 20, 20, 0.8);
    color: white;
    border: 1px solid var(--border);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    position: absolute;
    z-index: 10;
    transition: all 0.3s;
    backdrop-filter: blur(5px);
}

.carousel-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
    transform: scale(1.1);
}

.prev-btn { left: -25px; }
.next-btn { right: -25px; }

.youtube-link-wrapper {
    text-align: center;
    margin-top: 50px;
}

.btn-youtube {
    display: inline-block;
    background: #ef4444;
    color: white;
    padding: 12px 30px;
    border-radius: 4px;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 1px;
    transition: all 0.3s;
}

.btn-youtube:hover {
    background: #dc2626;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(239, 68, 68, 0.3);
}

@media (max-width: 992px) {
    .video-card { flex: 0 0 calc(50% - 15px); }
    .prev-btn { left: 10px; }
    .next-btn { right: 10px; }
}

@media (max-width: 600px) {
    .video-card { flex: 0 0 100%; }
    .carousel-btn { width: 40px; height: 40px; font-size: 1.2rem; }
}

/* --- CONTACT SECTION --- */
.contact-section { background-color: rgba(20,20,20,0.9); padding: 80px 40px; border-top: 1px solid var(--border); position: relative; z-index: 2; }
.contact-wrapper { max-width: 900px; margin: 0 auto; display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: start; }
.contact-info h3 { font-size: 1.8rem; margin-bottom: 15px; }
.contact-info p { color: var(--text-muted); font-size: 0.95rem; }
form { display: flex; flex-direction: column; gap: 15px; }
input, textarea { width: 100%; background: #0a0a0a; border: 1px solid var(--border); padding: 15px; color: white; font-family: inherit; font-size: 0.9rem; border-radius: 4px; transition: border 0.3s; }
input:focus, textarea:focus { outline: none; border-color: var(--primary); }
.btn-submit { background: white; color: black; border: none; padding: 12px 25px; font-weight: 700; cursor: pointer; border-radius: 2px; align-self: flex-start; transition: opacity 0.3s, transform 0.2s; }
.btn-submit:hover:not(:disabled) { opacity: 0.9; transform: scale(1.02); }
.btn-submit:disabled { opacity: 0.5; cursor: wait; }

/* --- SKELETON SCREENS --- */
.skeleton { 
    background: linear-gradient(90deg, #1a1a1a 25%, #2a2a2a 50%, #1a1a1a 75%); 
    background-size: 200% 100%; 
    animation: shimmer 1.5s infinite; 
    border-radius: 4px;
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.sk-img { width: 100%; height: 100%; min-height: 400px; }
.sk-tag { width: 40%; height: 20px; margin-bottom: 10px; }
.sk-title { width: 80%; height: 40px; margin-bottom: 20px; }
.sk-desc { width: 100%; height: 80px; margin-bottom: 30px; }
.sk-btn { width: 150px; height: 40px; }

/* --- DASHBOARD SECTION (MODAL / OVERLAY) --- */
#admin-view {
    display: none; /* Oculto por defecto */
    padding: 100px 20px;
    width: 100%;
    min-height: 100vh;
}
.dashboard-wrapper { max-width: 800px; margin: 0 auto; padding: 40px; background: rgba(20, 20, 20, 0.95); border: 1px solid var(--border); border-radius: 8px; width: 100%; box-shadow: 0 20px 50px rgba(0,0,0,0.5); backdrop-filter: blur(10px);}
.dashboard-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); padding-bottom: 20px; margin-bottom: 20px; }
.dashboard-header h2 { font-size: 1.8rem; color: var(--primary); }
.message-card { background: #0a0a0a; border: 1px solid var(--border); padding: 20px; margin-bottom: 15px; border-radius: 4px; }
.message-header { display: flex; justify-content: space-between; margin-bottom: 10px; color: var(--text-muted); font-size: 0.9rem; }
.message-body { font-size: 1rem; color: white; white-space: pre-wrap; }

/* --- FOOTER --- */
footer { padding: 30px 40px; text-align: center; font-size: 0.8rem; color: #555; background-color: #050505; border-top: 1px solid #111; margin-top: auto; width: 100%; }
.author-sig { color: #777; margin-top: 5px; font-style: italic; }

@media (max-width: 768px) {
    header { flex-direction: column; gap: 15px; }
    .header-right { flex-direction: column-reverse; width: 100%; gap: 15px; }
    .lang-selector { padding-left: 0; border-left: none; border-top: 1px solid rgba(255,255,255,0.1); padding-top: 10px; width: 100%; justify-content: center;}
    .hero h1 { font-size: 2.5rem; }
    .contact-wrapper { grid-template-columns: 1fr; gap: 30px; }
    .btn-submit { width: 100%; }
    .dropdown-menu { right: auto; left: 50%; transform: translateX(-50%); }
    .project-card { grid-template-columns: 1fr; }
    .project-image, .sk-img { min-height: 250px; }
    .project-info { padding: 30px 20px; }
}
