/* 1. VARIABLES Y CONFIGURACIÓN BASE */
:root {
    --bg-color: #e2e2e2;
    --card-main: #8e94f2;
    --circle-pink: #f2a7f2;
    --mint: #b8e2d4;
    --purple: #9d81e1;
    --yellow: #ffcf7d;
    --dark: #202020;
    --grey: #555555;
    --white: #ffffff;
    --border-main: 2px solid #000000; /* Borde solicitado */
    --radius-cards: 40px; /* Redondeado solicitado */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    display: grid;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* 2. CONTENEDOR PRINCIPAL */
.dashboard-container {
    background: var(--white);
    width: 100%;
    max-width: 1200px;
    min-height: 750px;
    border-radius: 30px;
    display: flex;
    overflow: hidden;
    padding: 25px;
    box-shadow: 0 25px 50px rgba(0,0,0,0.15);
    position: relative;
}

/* 3. SIDEBAR (Adaptable) */
.sidebar {
    width: 60px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding-bottom: 20px;
    display: none;
}

.nav-links {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    display: flex;
    gap: 25px;
    color: var(--grey);
    font-weight: bold;
    font-size: 14px;
}

/* Contenedor padre de la tarjeta debe ser relativo para posicionar la etiqueta */
.stat-card.modal-trigger, .video-card {
    position: relative;
    overflow: hidden; /* Evita que los bordes se salgan si la tarjeta tiene border-radius */
}

/* Estilos base de las etiquetas */
.badge {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 20px;
    color: #ffffff;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease;
}

.letr\.es {
  font-weight: bold;
  font-size: small;
}

/* Color Rojo para proyectos Privados */
.badge-private {
    background-color: #e63946; /* Rojo vibrante y profesional */
}

/* Color Verde/Cian para proyectos Públicos / Open Source */
.badge-public {
    background-color: #00f5d4; /* Turquesa/Verde brillante idéntico a tu captura */
    color: #000000; /* Texto oscuro para mejor contraste si el fondo es muy claro */
}

/* Efecto cuando el usuario pasa el mouse por encima de la tarjeta */
.stat-card:hover .badge {
    transform: scale(1.05);
}

/* 4. DISEÑO DE COLUMNAS */
.main-content {
    flex: 1;
    display: flex;
    gap: 25px;
}

/* --- SECCIÓN PERFIL --- */
.profile-column {
    flex: 0.85;
    position: relative;
    display: flex;
    flex-direction: column;
}

.about-me-header {
    position: absolute;
    top: 33px; 
    left: 25px;
    color: var(--dark);
    font-weight: 800;
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 20;
}

.about-me-header::before {
    content: "⁕"; 
    font-size: 24px;
    line-height: 0;
}

.profile-card {
    height: 100%;
    width: 100%;
    background-color: var(--card-main);
    border-radius: var(--radius-cards);
    position: relative;
    padding: 40px;
    color: white;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    overflow: hidden;
    border: var(--border-main);
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0,100 V15 Q0,10 5,10 H35 Q40,10 43,7 L50,0 H100 V100 Z' fill='black'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100' preserveAspectRatio='none'%3E%3Cpath d='M0,100 V15 Q0,10 5,10 H35 Q40,10 43,7 L50,0 H100 V100 Z' fill='black'/%3E%3C/svg%3E");
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
}

/* Contenedor central de la foto */
.profile-image-container {
    position: absolute;
    top: 31%;
    left: 60%;
    transform: translate(-50%, -50%);
    width: 320px;
    height: 320px;
}

.circle-bg {
    position: absolute;
    width: 230px;
    height: 230px;
    background-color: var(--circle-pink);
    border-radius: 50%;
    left: 15%;
    top: 15%;
}

.circle-border {
    position: absolute;
    width: 270px;
    height: 270px;
    border: 10px solid #fff;
    border-radius: 50%;
    left: 8%;
    top: 8%;
}

.profile-image-container img {
    width: 100%;
    height: auto;
    z-index: 5;
    filter: grayscale(100%);
    mask-image: linear-gradient(to bottom, black 90%, transparent 100%);
    -webkit-mask-image: linear-gradient(to bottom, black 90%, transparent 100%);
}

.profile-info h1 {
    font-size: 3.5rem;
    line-height: 0.9;
    margin-bottom: 15px;
    font-weight: 900;
}

.email-link {
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    border-bottom: 1px dashed rgba(255,255,255,0.4);
    padding-bottom: 4px;
}

/* Badge circular */
.badge-2023 {
    position: absolute;
    bottom: 30px;
    right: 30px;
    width: 90px;
    height: 90px;
    background: black;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.badge-2023 svg {
    position: absolute;
    width: 100%;
    height: 100%;
    fill: white;
    animation: rotate 12s linear infinite;
}

@keyframes rotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }

.year { color: white; font-weight: bold; font-size: 14px; z-index: 2; }

/* --- GRID DE CONTENIDO (DERECHA) --- */
.grid-content {
    flex: 1.2;
    display: grid;
    grid-template-columns: 1.6fr 1fr;
    grid-template-rows: auto 1fr 1fr;
    gap: 20px;
}

.header-portfolio {
    grid-column: span 2;
    position: relative;
}

.header-portfolio h2 {
    font-size: 5.5rem;
    font-weight: 900;
    letter-spacing: -3px;
    color: var(--dark);
    line-height: 1;
}

.corner-accent {
    position: absolute;
    top: 10px;
    right: 0;
    width: 20px;
    height: 20px;
    border-top: 3px solid #000;
    border-right: 3px solid #000;
}

.navegation {
    width: 100%;
    padding-bottom: 15px;
    overflow: hidden; /* Evita que el scroll afecte al layout general */
}

.navegation-links {
    display: flex;
    gap: 25px;
    color: var(--grey);
    font-weight: bold;
    font-size: 14px;
    
    /* Configuración de Scroll Horizontal */
    overflow-x: auto;
    flex-wrap: nowrap; /* Obliga a los items a quedarse en una sola línea */
    scroll-behavior: smooth; /* Hace que el scroll automático sea suave */
    -webkit-overflow-scrolling: touch; /* Mejora el scroll en dispositivos iOS */
    
    /* Ocultar la barra de scroll visualmente pero mantener la función */
    scrollbar-width: none; /* Firefox */
    padding-bottom: 5px; /* Espacio para que el borde inferior no se corte */
}

.navegation-links::-webkit-scrollbar {
    display: none; /* Chrome, Safari y Edge */
}
/* Tarjetas de Videos e Imágenes */
.video-card, .stat-card, .awards-card {
    border-radius: var(--radius-cards);
    border: var(--border-main);
    overflow: hidden;
    position: relative;
    cursor: pointer;
    background: #f0f0f0;
    transition: transform 0.3s ease;
}

/* Capa que aparece al hacer hover */
.video-card::after, .stat-card::after, .awards-card::after {
    content: "Ver Proyecto ↗";
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(142, 148, 242, 0.8); /* Tu color morado con transparencia */
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.video-card:hover::after, .stat-card:hover::after, .awards-card:hover::after {
    opacity: 1;
}

/* --- ESTILOS DEL MODAL --- */
.modal-overlay {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.8);
    display: none; /* Oculto por defecto */
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
}

.modal-content {
    background: var(--white);
    width: 90%;
    max-width: 600px;
    border-radius: var(--radius-cards);
    overflow: hidden;
    position: relative;
    animation: modalIn 0.4s ease;
}

@keyframes modalIn {
    from { transform: translateY(50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-content img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    border-bottom: var(--border-main);
}

.modal-text {
    padding: 30px;
    text-align: center;
}

.modal-text h2 { margin-bottom: 10px; color: var(--dark); }
.modal-text p { margin-bottom: 20px; color: var(--grey); line-height: 1.5; }

.close-modal {
    position: absolute;
    top: 15px; right: 20px;
    font-size: 30px;
    cursor: pointer;
    color: var(--dark);
    z-index: 11;
}

.video-card:hover, .stat-card:hover, .awards-card:hover {
    transform: scale(1.02);
}

.video-card video, 
.stat-card img, 
.awards-card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.stats-stack {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.stat-card.mint { background-color: var(--mint); }
.stat-card.purple { background-color: var(--purple); }
.awards-card { background-color: var(--yellow); }

/* Contenedor de la cuadrícula de clientes */
.clients-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 3 columnas */
    gap: 20px;
    padding: 20px;
}

/* Tarjeta individual de logo */
.client-card {
    background: #c6c6c6;
    border: 1px solid #f0f0f0;
    border-radius: 25px; /* Mismo redondeado que tus videos */
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px rgba(0,0,0,0.02);
}

.client-card img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    filter: grayscale(100%); /* Logos en gris por defecto */
    opacity: 0.6;
    transition: all 0.3s ease;
}

/* Efecto al pasar el mouse */
.client-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.05);
    border-color: #8e94f2; /* Color de tu perfil en image_2c1ff0.jpg */
}

.client-card:hover img {
    filter: grayscale(0%); /* El logo recupera su color */
    opacity: 1;
}

/* Estilos para Habilidades */
.skills-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    padding: 20px;
}

.tags-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 15px;
}

.tag {
    padding: 8px 15px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 700;
}

.tag.purple { background: #8e94f2; color: white; }

.soft-skills-list {
    list-style: none;
    padding: 0;
    margin-top: 15px;
}

.soft-skills-list li {
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
}

/* Estilos para Curriculum */
.resume-container {
    padding: 20px;
}

.resume-section h4 {
    margin-bottom: 20px;
    border-left: 4px solid #8e94f2;
    padding-left: 10px;
}

.resume-item {
    margin-bottom: 25px;
    position: relative;
    padding-left: 20px;
}

.resume-item .date {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: #888;
}

.resume-item h5 {
    margin: 5px 0;
    font-size: 16px;
}

.resume-item p {
    font-size: 14px;
    color: #666;
}

.download-container {
    padding: 20px;
    display: flex;
    justify-content: center; /* Centra el botón */
}

.btn-download {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background-color: #8e94f2; /* Color de tu diseño */
    color: white;
    padding: 12px 25px;
    border-radius: 15px;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(142, 148, 242, 0.3);
}

.btn-download:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(142, 148, 242, 0.5);
    background-color: #7a81e0;
}

.btn-download i {
    font-size: 16px;
}

/* Contenedor principal derecho */
.main-column-right {
    flex: 1.2;
    display: flex;
    flex-direction: column;
    height: 700px; /* Toma el alto total del dashboard */
    overflow: hidden;
}

.scroll-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 10px;
    
    /* El truco para iOS */
    -webkit-overflow-scrolling: touch; 
}

/* Personalización del scroll para Chrome/Edge/Safari */
.scroll-container::-webkit-scrollbar {
    width: 6px;
}
.scroll-container::-webkit-scrollbar-thumb {
    background-color: #8e94f2;
    border-radius: 10px;
}

/* Control de vistas */
.view-content {
    display: none; /* Oculta las vistas por defecto */
}
.view-content.active {
    display: block; /* Muestra solo la vista activa */
}

.nav-item {
    cursor: pointer;
    flex-shrink: 0; /* Evita que los nombres se encojan para caber */
    white-space: nowrap; /* Asegura que el texto no se rompa en dos líneas */
    font-weight: 700;
    color: #555;
    transition: 0.3s;
    border-bottom: 2px solid transparent;
}

.nav-item.active, .nav-item:hover {
    color: #000;
    border-bottom: 2px solid #000;
}

.lang-switcher {
    display: flex;
    align-content: center;
    gap: 6px;
    width: 100%;
    position: absolute;
    left: -7px;
    top: -2%;
    z-index: 1;
}

#lang-es, #lang-en {
    height: auto;
    width: 5%;
}

/* ==========================================================================
   5. ESTILOS DE LA SECCIÓN DE CONTACTO
   ========================================================================== */
.contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
    padding: 20px 5px;
}

.contact-card {
    background: var(--white);
    border: var(--border-main);
    border-radius: var(--radius-cards);
    padding: 35px;
    display: flex;
    flex-direction: column;
}

/* Tarjeta WhatsApp */
.whatsapp-card {
    background-color: var(--mint);
    justify-content: center;
    align-items: center;
    text-align: center;
}

.whatsapp-card .contact-icon {
    font-size: 3.5rem;
    margin-bottom: 10px;
}

.whatsapp-card h3 {
    font-size: 1.6rem;
    font-weight: 900;
    color: var(--dark);
    margin-bottom: 12px;
    line-height: 1.2;
}

.whatsapp-card p {
    font-size: 0.95rem;
    color: var(--grey);
    margin-bottom: 30px;
    line-height: 1.5;
}

/* Tarjeta Formulario */
.form-card h3 {
    font-size: 1.8rem;
    font-weight: 900;
    color: var(--dark);
    margin-bottom: 25px;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px 18px;
    border: var(--border-main);
    border-radius: 15px;
    font-family: inherit;
    font-size: 0.95rem;
    background: #f7f7f7;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    background: var(--white);
    box-shadow: 4px 4px 0px #000000;
}

/* Botones de acción */
.btn-contact {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 14px 28px;
    border-radius: 15px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: var(--border-main);
}

.btn-contact.whatsapp {
    background-color: var(--dark);
    color: var(--white);
    width: 100%;
}

.btn-contact.submit {
    background-color: var(--purple);
    color: var(--white);
    width: 100%;
}

/* Efectos Hover (Feedback Neo-brutalista) */
.btn-contact:hover {
    transform: translate(-2px, -2px);
    box-shadow: 4px 4px 0px #000000;
}

.btn-contact:active {
    transform: translate(0px, 0px);
    box-shadow: 0px 0px 0px #000000;
}

.conte_footer_iu {
    text-align: center;
    width: 100%;
}
.sms_footer {
    font-size: 0.9rem;
}

/* Tablets y Laptops pequeñas */
@media (max-width: 1024px) {
    .conte_footer_iu {
        margin-top: 6%;
    }
    .dashboard-container {
        height: auto;
        flex-direction: column;
    }
    .main-content {
        flex-direction: column;
    }
    
    /* LIBERAR SCROLL EN MÓVIL: Evita que estos contenedores atrapen el dedo en iOS */
    .main-column-right {
        height: auto !important;
        overflow: visible !important;
    }
    .scroll-container {
        height: auto !important;
        overflow: visible !important;
        padding-right: 0; /* Ya no necesitas espacio para la barra interna */
    }

    .profile-column {
        height: 500px;
        flex: none;
    }
    .about-me-header {
        top: 15px;
        left: -1px;
    }
    .profile-image-container img {
        left: 11%;
        position: relative;
        bottom: 17%;
    }
    .profile-card { padding: 40px 20px; }
    .skills-grid { grid-template-columns: 1fr; }
    .badge-2023 {
        bottom: 62px;
        right: 7px;
    }
    .header-portfolio h2 {
        font-size: 3rem;
        margin-bottom: 1rem;
    }
    .sidebar {
        width: 100%;
        flex-direction: row;
        justify-content: center;
        padding: 10px 0;
    }
    .nav-links {
        writing-mode: horizontal-tb;
        transform: none;
    }
}

/* Ajuste específico para pantallas de celulares */
@media (max-width: 768px) {
    .clients-container {
        grid-template-columns: repeat(1, 1fr); 
    }

    /* Aseguramos que en pantallas más pequeñas se mantenga el flujo natural */
    .main-column-right {
        display: flex;
        flex-direction: column;
        height: auto !important;
        min-height: 0;
        overflow: visible !important;
    }
    
    .scroll-container {
        overflow: visible !important;
        height: auto !important;
    }

    .contact-grid {
        grid-template-columns: 1fr; /* Pasa a una columna en pantallas medianas/móviles */
    }

    .clients-container {
        grid-template-columns: repeat(1, 1fr); /* 2 columnas en móvil */
    }

    .main-column-right {
        display: flex;
        flex-direction: column;
        
        /* Obliga a Safari a calcular el espacio real en vez de estirarse al infinito */
        height: 100%; 
        min-height: 0; 
    }

    .grid-content {
        grid-template-columns: 1fr; /* Una sola columna */
    }
    .header-portfolio h2 {
        font-size: 3rem;
    }
    .profile-info h1 {
        font-size: 2.5rem;
    }
    .profile-image-container {
        width: 250px;
        height: 250px;
        left: 50%;
    }
}