/* =========================================
   PORTFOLIO STYLES
   ========================================= */

/* Paleta de Colores basada en el diseño de tarjetas (Violeta/Fucsia) */
:root {
    --color-primary-dark: #250456;
    /* Violeta Oscuro principal (Fondo de Header/Footer) */
    --color-base-dark: #190B38;
    /* Violeta más oscuro (Fondo principal body) */
    --color-accent: #FE2552;
    /* Fucsia/Rojo Candelá para CTAs y resaltes */
    --color-text-light: #FFFFFF;
    --color-text-dark: #000000;
    --color-card-background: #FFFFFF;
    /* Fondo de tarjetas */
}

/* Nota: Los estilos generales (body reset, fonts) vienen de main styles.css */
/* Sobreescribimos solo lo necesario para esta página */

body {
    background-color: var(--color-base-dark);
    /* Fondo específico del portfolio */
    background-image: url('../img/fondos/fondo-portfolio.png');
    background-size: cover;
    background-attachment: fixed;
    /* Parallax suave */
    background-repeat: no-repeat;
    background-position: center center;
}

.contenedor-principal {
    margin-right: 8%;
    margin-left: 8%;
    max-width: 84%;
}

/* Overlay sutil para mejorar la legibilidad sobre el fondo Parallax */
.section-overlay {
    background-color: rgba(25, 11, 56, 0.85);
    /* 85% opacidad del color más oscuro */
    padding: 60px 0;
}


.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 0;
}

h1,
h2,
h3,
h4 {
    font-weight: 700;
    color: var(--color-text-light);
}

h2.section-title {
    font-size: 2.5em;
    text-align: center;
    margin-bottom: 40px;
    color: var(--color-text-light);
}

/* ----------------------------------
    BOTONES Y CTAS (Fucsia/Rojo)
------------------------------------- */

/* Botón principal (VER PROYECTOS / EMPEZAR PROYECTO) */
.ver-proyectos {
    display: inline-block;
    padding: 15px 40px;
    font-size: 1em;
    font-weight: bold;
    text-decoration: none;
    text-align: center;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;

    background-color: var(--color-accent);
    color: var(--color-text-light);
    border: none;
    box-shadow: 0 5px 15px rgba(254, 37, 82, 0.4);
}

.ver-proyectos:hover {
    background-color: #FF5A7D;
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(254, 37, 82, 0.7);
}

/* Botón de CONSULTA (Transparente con borde Fucsia) */
.secondary-ver-proyectos {
    display: inline-block;
    padding: 15px 40px;
    font-size: 1em;
    font-weight: bold;
    text-decoration: none;
    text-align: center;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-left: 20px;

    background-color: transparent;
    color: var(--color-text-light);
    border: 2px solid var(--color-accent);
}

.secondary-cta-button:hover {
    background-color: var(--color-accent);
    color: var(--color-text-light);
}


/* ----------------------------------
    HERO SECTION (Contenido encima del fondo)
------------------------------------- */
.scroll-reveal {
    opacity: 0;
    /* Si esto falta, el elemento siempre será visible */
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    will-change: opacity, transform;
}

.scroll-reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

.hero-section {
    padding-top: 30px;
    /* Separación del header */
    padding-bottom: 30px;
    margin-top: 150px;
    text-align: left;
    /* Usamos el overlay del fondo del body para esta sección */
    background-color: rgba(25, 11, 56, 0.25);
    display: flex;
    justify-content: center;
}

.hero-content {
    max-width: 800px;
    margin: 0;
    /* Alinear a la izquierda */
}

.hero-content h1 {
    font-size: 3em;
    line-height: 1.1;
    margin-bottom: 15px;
}

.hero-content h1 span {
    color: var(--color-accent);
}

.hero-subtitle {
    font-size: 1.5em;
    font-weight: 300;
    margin-bottom: 40px;
    color: #CCCCCC;
}

/* ----------------------------------
    ESTILOS ESPECÍFICOS DEL PORTAFOLIO
------------------------------------- */


/* Ocultar las tarjetas que no coinciden con el filtro */
.portfolio-grid .filter-item.hidden {
    display: none !important;
}

/* Opcional: Estilo para el botón de filtro activo */
.tags-filter .filter-button {
    /* ... Tus estilos de botón normales ... */
    border: 2px solid transparent;
    padding: 8px 15px;
    border-radius: 20px;
    text-decoration: none;
    color: #FFFFFF;
    background-color: rgba(255, 255, 255, 0.1);
    /* Fondo sutil */
    transition: background-color 0.3s, border-color 0.3s;
    font-size: 1.2em;
    font-weight: 600;
}

.tags-filter .filter-button.active {
    background-color: #FE2552;
    /* Color de acento para el botón seleccionado */
    border-color: #FE2552;
}

.content-section {
    background-color: #000f3c;
    /* Color de fondo base para secciones */
    padding: 80px 0;
    /* Secciones sin overlay para un contraste más duro */
}

.section-label {
    text-transform: uppercase;
    font-size: 1.5em;
    font-weight: 700;
    margin-bottom: 0;
    color: white;
    order: 1;

}

.titulo-portfolio {
    display: flex;
}

.hr-portfolio {
    height: 2.5px;
    background-color: #FFFFFF;
    width: 30px;

    /* Mantenemos solo los márgenes laterales */
    margin: 0;

    /* El margen a la izquierda del HR lo separa del título P */
    margin-left: 15px;

    /* Aseguramos que se mantenga en el medio del grupo inicial */
    order: 0;
    /* 👈 CLAVE: Forzar la alineación y el espaciado correcto */
    /* Aseguramos que la línea se coloque inmediatamente al lado del título */
    margin-right: 15px;

    /* 👈 Alinear verticalmente el HR con el P */
    align-self: center;

    /* El orden visual lo queremos después del título */
    order: 0;
    /* Le damos el orden 1 (después del título, que tendrá orden 0) */
}



/* Tags de Filtro */
.tags-filter a {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--color-text-light);
    padding: 8px 20px;
    border-radius: 30px;
    margin-right: 10px;
    font-size: 0.9em;
    font-weight: 600;
    transition: background-color 0.2s;
    order: 2;
}

.tags-filter a:hover {
    background-color: var(--color-accent);
}

.portfolio-header-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

/* Grid de Portafolio Destacado */
.portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    /* 1 columna grande + 3 columnas pequeñas */
    gap: 30px;
    margin-bottom: 60px;
}

.portfolio-card {
    background-color: var(--color-card-background);
    /* Fondo Blanco */
    color: var(--color-text-dark);
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Estilo para el card grande de imagen */
.portfolio-card.large-image-card {
    grid-column: span 1;
    background-color: transparent;
    box-shadow: none;
    padding: 0;
}

.portfolio-card.large-image-card img {
    width: 100%;
    height: auto;
    border-radius: 12px;
    object-fit: cover;
    display: block;
}

.read-more-button {
    background-color: #FF6E30;
    font-size: larger;
    text-align: center;
    text-decoration: none;
    display: flex;
    color: #ffff;
    height: 50px;
    justify-content: center;
    align-items: center;
}

.read-more-button:hover {
    background-color: #ffffff;
    color: #FF6E30;
    cursor: pointer;
    border: 1px solid #4b4745;
    transition: background-color 0.1s;
}

.portfolio-pocard.filter-item.apps {
    max-height: 450px;
    overflow: hidden;
}

.portfolio-pocard.filter-item.apps img {
    max-height: 420px;
}

.portfolio-card img {
    width: 100%;
    height: 100%;
    /* CLAVE: Intenta llenar el 100% de la tarjeta */
    object-fit: cover;
    /* CLAVE: Recorta la imagen (arriba/abajo) para que quepa sin distorsión */
    flex-grow: 0;
    /* Permite que la imagen ocupe el espacio no usado por el botón */
}

/*-------------------------------
PORTFOLIO MODAL*/

/* -------------------------------------- */
/* ESTILOS BASE Y OCULTAMIENTO DEL MODAL */
/* -------------------------------------- */
.modal {
    display: none;
    /* Oculto por defecto */
    position: fixed;
    z-index: 1000;
    /* Asegura que esté por encima de todo */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    /* Mantenemos overflow: auto aquí para scroll si el contenido es grande */
    background-color: rgba(0, 0, 0, 0.411);
    /* Fondo oscuro semitransparente */

    /* ❌ ELIMINAR: padding-top: 50px; (Esto es lo que empuja hacia abajo) */
    padding-top: 0;
    /* ❌ ELIMINAR: align-items: center; (No funciona sin display: flex) */
}

.modal-content {
    background-color: #000f3c;
    padding: 20px;
    border-radius: 12px;

    /* Mantenemos el tamaño que te gusta */
    width: 80%;
    max-width: 1800px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.5);

    /* 🎯 CLAVE 1: MÁRGENES DE CENTRADO HORIZONTAL */
    margin: auto;
    /* Mantenemos 'auto' para el centrado horizontal */

    /* 🎯 CLAVE 2: CENTRADO VERTICAL ABSOLUTO */
    /* Usamos position: relative en .modal-content si el padre es overflow: auto
       Para centrado estricto y sin margin, necesitamos estas propiedades: */

    position: absolute;
    /* Posicionamiento respecto a .modal */
    top: 50%;
    /* Mueve el inicio al 50% de la altura */
    left: 50%;
    /* Mueve el inicio al 50% del ancho */

    /* 🎯 CLAVE 3: COMPENSACIÓN (Mueve la ventana hacia atrás por la mitad de su tamaño) */
    transform: translate(-50%, -50%);

    /* ⚠️ ADICIONAL: Si el contenido es muy alto, asegura que no se salga de la ventana */
    max-height: 90vh;
    /* Limita la altura de la ventana del modal al 90% del viewport */
    overflow-y: auto;
    /* Permite scroll interno si es necesario */
}

.close-button {
    color: #aaa;
    float: right;
    width: 30px;
    height: 30px;
    display: flex;
    font-size: 30px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    position: relative;
    background: #ffffff;
    border-radius: 40px;
    z-index: 10;
    align-content: center;
    justify-content: center;
}

.close-button:hover,
.close-button:focus {
    color: #FE2552;
    text-decoration: none;
}

/* -------------------------------------- */
/* ESTILOS DE ESTRUCTURA INTERNA DEL MODAL */
/* -------------------------------------- */
.modal-body {
    display: flex;
    gap: 30px;
    align-items: center;
}

.modal-gallery {
    flex: 2;
    /* Ocupa 2/3 del espacio */
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.modal-description {
    flex: 1;
    /* Ocupa 1/3 del espacio */
    padding: 10px;
    text-align: left;
    font-size: 1.4em;
}

.main-project-image {
    width: 100%;
    height: auto;
    max-height: 800px;
    /* Limita la altura máxima de la imagen principal */
    object-fit: contain;
    /* Mantiene la proporción y ajusta dentro del contenedor */
    display: block;
    margin-bottom: 15px;
}

/* Estilos para las flechas de navegación */
.gallery-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    color: white;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    font-size: 20px;
    z-index: 10;
    border-radius: 50%;
}

.prev-button {
    left: 10px;
}

.next-button {
    right: 10px;
}

#modal-main-image {
    border-radius: 20px;
    width: 100%;
}

#modal-link {
    font-weight: 700;
    color: #ffffff;
    margin-top: 20px;
    background: #fe2552;
    padding: 10px;
    border-radius: 15px;
    font-size: 15px;
    text-decoration: none;
}

#modal-link:hover {
    background: #fe2552;
    padding: 10px;
    border-radius: 15px;
}

#modal-title {
    margin-bottom: 20px;
}

#modal-text {
    font-weight: 400;
    font-size: 13px;
}

/* ----------------------------------
    5. LLAMADO A LA ACCIÓN INFERIOR (Banner Fucsia)
------------------------------------- */

.cta-banner-bottom {
    background-color: var(--color-accent);
    padding: 20px 40px;
    border-radius: 15px;
    text-align: center;
    margin-top: 40px;
    margin-bottom: 40px;
}

.cta-banner-bottom h2 {
    color: var(--color-text-light);
    font-size: 2.8em;
    margin-bottom: 30px;
}

/* Botón de la CTA inferior */
.cta-banner-bottom .ver-proyectos {
    background-color: var(--color-primary-dark);
    /* Violeta Oscuro */
    color: var(--color-text-light);
    box-shadow: none;
    font-size: 1.5em;
}

.cta-banner-bottom .ver-proyectos:hover {
    background-color: #361B5E;
}

.cta-banner-bottom img {
    margin-left: 10px;
}

/* ----------------------------------
    8. CONTACTO Y FORMULARIO
------------------------------------- */

.contact-section {
    background-color: #000f3c;
    /* Azul Marino Oscuro */
    padding-top: 80px;
    padding-bottom: 80px;
}

.contact-label {
    margin-top: 0;
    margin-bottom: 0;
    text-align: left;
    font-size: 1.7em;
    font-weight: 600;
    color: #FFFFFF;

}

.contenedor-contacto {
    /* 1. Propiedades Flexbox */
    display: flex;
    align-items: center;

    /* 2. Propiedad Clave: Padding Izquierdo */
    padding-left: 100px;
    /* Ajusta este valor (100px es un ejemplo) */
    padding-top: 50px;
    margin-bottom: 60px;
}

.hr-contacto {
    border: none;
    height: 2.5px;
    background-color: #FFFFFF;
    width: 30px;

    /* Márgenes para separar la línea del texto */
    margin: 0;
    margin-right: 15px
}

.contact-form-wrapper {
    max-width: 1000px;
    margin: 0 auto;
    background-color: #ff6d40;
    /* Naranja Vibrante */
    color: #FFFFFF;
    padding: 60px;
    border-radius: 12px;
    text-align: center;
}

.contact-form-wrapper h3 {
    color: #FFFFFF;
    font-size: 2.5em;
    margin-bottom: 30px;
}

.contact-form {
    text-align: left;
    font-size: large;
    font-weight: bold;
}

.form-row {
    display: flex;
    gap: 20px;
}

.form-group {
    margin-bottom: 20px;
    flex: 1;
}

.contact-form input::placeholder,
.contact-form textarea::placeholder {
    color: #C25022;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #ff6d40;
    border-radius: 4px;
    font-size: 1.3em;
    background-color: #f9c0af;
    color: #FFFFFF;
    border-radius: 8px;
}

.contact-form .submit-button {
    display: block;
    margin: 30px auto 0;
    width: 100%;
    max-width: 200px;
    border-radius: 20px;
    font-size: larger;

}


/* ----------------------------------
    RESPONSIVE (Ajustes para móviles)
------------------------------------- */

@media (max-width: 991px) {

    /* HERO */
    .hero-content h1 {
        font-size: 2.5em;
    }

    .hero-subtitle {
        font-size: 1.2em;
    }

    /* GRID DE PORTFOLIO/SERVICIOS */
    .portfolio-grid {
        grid-template-columns: 1fr 1fr;
        /* Colapsa a 2 columnas */
    }

    .portfolio-card.large-image-card {
        grid-column: span 2;
        /* Ocupa todo el ancho en la parte superior */
    }

    /* CTA INFERIOR */
    .cta-banner-bottom {
        padding: 60px 20px;
    }

    .cta-banner-bottom h2 {
        font-size: 2em;
    }

    /* BOTONES */
    .ver-proyectos,
    .secondary-cta-button {
        display: block;
        margin: 10px 0 10px 0;
        width: 100%;
    }

    .secondary-cta-button {
        margin-left: 0;
    }


}

@media (max-width: 920px) {
    .portfolio-grid {
        grid-template-columns: 1fr;
        /* Colapsa a 1 columna */
    }

    .portfolio-card.large-image-card {
        grid-column: span 1;
    }

    .portfolio-header-section {
        flex-direction: column;
        align-items: flex-start;
    }

    .tags-filter {
        margin-top: 15px;
        display: contents;
    }

    .tags-filter a {
        margin-bottom: 5px;
    }
}
