/* ============================================================
   SITE.CSS – Portfolio Profesional de Ing. Meydell Lezama
   Estilo: Elegant Blue Corporate Advanced 2.0
   ============================================================ */

/* ===== PALETA DE COLORES ===== */
:root {
    --primary-blue: #1B2559;
    --accent-blue: #3BA6E3;
    --gold: #FECF40;
    --light-bg: #F5F7FA;
    --white: #FFFFFF;
    --gray: #6c757d;
}

/* ===== RESET GLOBAL ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--light-bg);
    color: #222;
    overflow-x: hidden;
}

/* ===== NAVBAR ===== */
.navbar {
    background-color: var(--primary-blue);
    transition: all 0.4s ease-in-out;
}

    .navbar.scrolled {
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
        background-color: rgba(27, 37, 89, 0.97);
    }

.navbar-brand {
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--white) !important;
}

.navbar .nav-link {
    color: #f1f1f1;
    font-weight: 500;
    margin-left: 1rem;
    transition: color 0.3s ease;
}

    .navbar .nav-link:hover,
    .navbar .nav-link.active {
        color: var(--gold);
    }

/* ===== LOADER ===== */
#page-loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(27, 37, 89, 0.95);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    transition: opacity 0.8s ease;
}

    #page-loader.fade-out {
        opacity: 0;
        visibility: hidden;
    }

.loader-logo {
    width: 80px;
    height: 80px;
    animation: spin 3s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ===== HERO SECTION ===== */
.hero-section {
    min-height: 100vh;
    background: linear-gradient(120deg, var(--primary-blue), var(--accent-blue));
    background-size: 200% 200%;
    animation: gradientFlow 10s ease infinite;
    padding-top: 6rem;
    padding-bottom: 4rem;
}

@keyframes gradientFlow {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.hero-photo {
    width: 250px;
    height: 250px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--gold);
    transition: transform 0.5s ease, box-shadow 0.5s ease;
}

    .hero-photo:hover {
        transform: scale(1.05);
        box-shadow: 0 0 25px rgba(254, 207, 64, 0.6);
    }

/* ===== SECTION TITLES ===== */
.section-title {
    font-weight: 700;
    color: var(--primary-blue);
    text-transform: uppercase;
    position: relative;
    margin-bottom: 1.5rem;
    display: inline-block;
}

    .section-title::after {
        content: '';
        display: block;
        width: 60px;
        height: 3px;
        background: var(--gold);
        margin: 10px auto 0;
        border-radius: 3px;
    }

/* ===== ABOUT ===== */
#about p {
    color: black !important;
    line-height: 1.7;
}

#about img {
    border-radius: 12px;
    transition: transform 0.5s ease;
}

    #about img:hover {
        transform: scale(1.03);
    }

/* ===== SERVICES ===== */
#services {
    background-color: var(--white);
}

.service-card {
    border-radius: 15px;
    transition: all 0.4s ease;
    background-color: var(--white);
    border: none;
}

    .service-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
    }

    .service-card i {
        font-size: 3rem;
        color: var(--accent-blue);
    }

.tech-icons i {
    font-size: 1.8rem;
    margin: 0 5px;
    transition: transform 0.3s ease, color 0.3s ease;
}

    .tech-icons i:hover {
        transform: scale(1.2);
        color: var(--gold);
    }

/* ===== SKILLS ===== */
#skills {
    background-color: var(--light-bg);
}

.skill-icon {
    max-width: 70px;
    transition: transform 0.4s ease, filter 0.4s ease;
    filter: grayscale(80%);
}

    .skill-icon:hover {
        transform: scale(1.1);
        filter: grayscale(0%);
    }

/* ===== PORTFOLIO ===== */
#portfolio .card {
    border: none;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.4s ease;
}

    #portfolio .card:hover {
        transform: translateY(-5px);
        box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    }

#portfolio img {
    height: 230px;
    object-fit: cover;
    transition: transform 0.4s ease, filter 0.4s ease;
}

    #portfolio img:hover {
        transform: scale(1.05);
        filter: brightness(1.1);
    }

#portfolio .card-body h5 {
    color: var(--primary-blue);
    font-weight: 600;
}

/* ===== CONTACT ===== */
#contact {
    background-color: var(--primary-blue);
    padding: 5rem 0;
}

    #contact .btn {
        border-radius: 50px;
        font-weight: 600;
        transition: all 0.3s ease;
    }

    #contact .btn-warning:hover {
        background-color: var(--gold);
        color: var(--primary-blue);
        transform: scale(1.05);
    }

    #contact .btn-outline-light:hover {
        background-color: var(--accent-blue);
        border-color: var(--accent-blue);
    }

/* ===== FOOTER ===== */
footer {
    background-color: var(--primary-blue);
    color: #ccc;
}

    footer i {
        transition: color 0.3s ease, transform 0.3s ease;
    }

        footer i:hover {
            color: var(--gold);
            transform: scale(1.2);
        }

/* ===== SCROLL TO TOP BUTTON ===== */
#scrollTopBtn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: var(--accent-blue);
    border: none;
    color: var(--white);
    padding: 12px;
    border-radius: 50%;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
    z-index: 999;
}

    #scrollTopBtn.show {
        opacity: 1;
        visibility: visible;
    }

    #scrollTopBtn:hover {
        background-color: var(--gold);
        color: var(--primary-blue);
    }

/* ===== RESPONSIVE MEDIA QUERIES ===== */
@media (max-width: 992px) {
    .hero-photo {
        width: 200px;
        height: 200px;
    }

    .section-title {
        font-size: 1.6rem;
    }

    .service-card {
        padding: 1.5rem 1rem;
    }

    #portfolio img {
        height: 200px;
    }
}

@media (max-width: 768px) {
    .hero-section {
        text-align: center;
        padding-top: 7rem;
    }

    .navbar .nav-link {
        text-align: center;
        margin-left: 0;
    }

    .hero-photo {
        width: 180px;
        height: 180px;
    }

    .service-card i {
        font-size: 2.5rem;
    }
}

@media (max-width: 576px) {
    .hero-photo {
        width: 150px;
        height: 150px;
    }

    #portfolio img {
        height: 160px;
    }

    .tech-icons i {
        font-size: 1.5rem;
    }
}

/* ============================================================
   PRELOADER – Elegant Blue Corporate Advanced
   ============================================================ */

#page-loader {
    position: fixed;
    inset: 0;
    background: rgba(10, 15, 40, 0.95);
    z-index: 3000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: opacity 0.8s ease, visibility 0.8s ease;
}

    #page-loader.fade-out {
        opacity: 0;
        visibility: hidden;
    }

.loader-logo {
    width: 90px;
    height: 90px;
    animation: spin 3s linear infinite;
    filter: drop-shadow(0 0 15px rgba(59, 166, 227, 0.7));
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.blink-smooth {
    animation: blink 2s infinite ease-in-out;
}

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }
}

/* Evita scroll durante la carga */
body.no-scroll {
    overflow: hidden;
}


.skill-icon i {
    font-size: 3rem;
    transition: transform 0.3s ease, filter 0.3s ease;
}

    .skill-icon i:hover {
        transform: scale(1.15);
        filter: brightness(1.2);
    }

#skills p {
    margin-top: 0.5rem;
    font-weight: 500;
    color: #1B2559;
}

/* ====== FOTO ABOUT (estilo profesional y responsivo) ====== */
.about-photo {
    width: 100%;
    max-width: 420px;
    aspect-ratio: 1/1;
    border-radius: 20px;
    object-fit: cover;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
    transition: all 0.5s ease;
    border: 4px solid #ffffff;
}

    .about-photo:hover {
        transform: scale(1.03);
        box-shadow: 0 12px 35px rgba(27, 37, 89, 0.4);
    }

/* En pantallas pequeñas: centrada y reducida */
@media (max-width: 768px) {
    .about-photo {
        max-width: 300px;
        border-radius: 15px;
        margin-bottom: 20px;
    }
}

/* ==== SERVICE CARDS MODERN ==== */
.service-card {
    position: relative;
    border: none;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    overflow: hidden;
}

    .service-card:hover {
        transform: translateY(-6px);
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.1);
    }

.service-header {
    padding: 1.8rem 1.2rem 1.2rem;
}

    .service-header i {
        font-size: 2rem;
        color: #3BA6E3;
        margin-bottom: 0.8rem;
    }

    .service-header h5 {
        font-weight: 700;
        color: #1B2559;
    }

    .service-header p {
        color: #555;
        font-size: 0.95rem;
    }

/* === Detalle expandible === */
.service-details {
    max-height: 0;
    overflow: hidden;
    background: #F8FAFC;
    transition: max-height 0.5s ease, opacity 0.4s ease;
    opacity: 0;
    border-top: 3px solid #3BA6E3;
    padding: 0 1.25rem;
}

.service-details h6 {
    color: #1B2559;
    font-weight: 700;
    margin-top: 1rem;
}

.service-details ul {
    text-align: left;
    padding-left: 1.2rem;
    margin-bottom: 0.8rem;
}

.service-details li {
    font-size: 0.9rem;
    color: #444;
    margin-bottom: 0.3rem;
}

.service-actions {
    padding: 1rem;
    border-top: 1px solid rgba(0,0,0,0.05);
    text-align: center;
    background: #fff;
}

.toggle-details {
    border-radius: 50px;
    padding: 0.45rem 1.5rem;
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}



/* === Animaciones únicas y sin duplicados === */
@keyframes fadeInCta {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes floatIcon {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-6px);
    }
}

@keyframes typing {
    from {
        width: 0ch;
    }

    to {
        width: 100%;
    }
}

@keyframes blinkCursor {
    50% {
        border-color: transparent;
    }
}

/* === Fix visual para expansión individual sin afectar otros === */
.service-card {
    display: flex;
    flex-direction: column;
    transition: all 0.4s ease;
    position: relative;
}

    .service-card .service-details {
        max-height: 0;
        opacity: 0;
        overflow: hidden;
        transition: max-height 0.6s ease, opacity 0.5s ease;
    }

    .service-card.expanded .service-details {
        max-height: 600px; /* espacio suficiente para el contenido */
        opacity: 1;
    }

/* Evita que el crecimiento empuje las demás columnas */
#services .row {
    align-items: start; /* cada columna crece independientemente */
}

/* Evita huecos cuando otras tarjetas no están expandidas */
@media (min-width: 768px) {
    #services .col-md-4 {
        display: flex;
        align-items: stretch;
    }

    .service-card {
        height: auto;
    }
}


#certCarousel img {
    transition: transform 0.4s ease;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.1));
}

    #certCarousel img:hover {
        transform: scale(1.08);
    }


/* === BOTÓN PERSONALIZADO (paleta corporativa) === */
.btn-gradient {
    background: linear-gradient(90deg, #263688 0%, #439CD6 100%);
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 10px 28px;
    font-weight: 600;
    transition: all 0.3s ease-in-out;
}

    .btn-gradient:hover {
        background: linear-gradient(90deg, #439CD6 0%, #263688 100%);
        transform: translateY(-3px);
        box-shadow: 0 6px 12px rgba(38, 54, 136, 0.25);
    }

/* === TEXTOS Y CONTRASTES === */
.section-title {
    color: #263688 !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.text-secondary {
    color: white !important;
    line-height: 1.6;
}

/* === CARRUSEL === */
#certCarousel .carousel-inner {
    background-color: #f9fbfd;
    border: 1px solid #e3e8f0;
}

#certCarousel img {
    transition: transform 0.4s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

    #certCarousel img:hover {
        transform: scale(1.1);
    }

/* === RESPONSIVE === */
@media (max-width: 767px) {
    #about .col-md-6 {
        text-align: center;
    }

    .btn-gradient {
        width: 80%;
    }

    #certCarousel .carousel-inner {
        padding: 1.5rem;
    }
}
.cursor {
    display: inline-block;
    width: 3px;
    height: 1em;
    background-color: #FDE73C; /* amarillo corporativo */
    margin-left: 3px;
    vertical-align: bottom;
}

.blink {
    animation: blinkCursor 0.8s steps(2, start) infinite;
}

@keyframes blinkCursor {
    to {
        visibility: hidden;
    }
}

/* ===== MODERN BUTTON STYLES (Elegant Blue Corporate) ===== */
.btn-modern {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    padding: 0.85rem 1.8rem;
    border-radius: 50px;
    letter-spacing: 0.5px;
    text-decoration: none;
    overflow: hidden;
    transition: all 0.4s ease;
    font-size: 1.05rem;
}

.btn-main {
    background: linear-gradient(135deg, #263688, #439CD6);
    color: #fff;
    box-shadow: 0 4px 15px rgba(38, 54, 136, 0.4);
    border: none;
}

    .btn-main:hover {
        background: linear-gradient(135deg, #1B2559, #3BA6E3);
        box-shadow: 0 6px 20px rgba(67, 156, 214, 0.5);
        transform: translateY(-3px);
    }

.btn-outline {
    background: transparent;
    color: #FDE73C;
    border: 2px solid #FDE73C;
}

    .btn-outline:hover {
        background: #FDE73C;
        color: #1B2559;
        box-shadow: 0 6px 18px rgba(253, 231, 60, 0.5);
        transform: translateY(-3px);
    }

/* Efecto brillante al pasar */
.btn-modern::after {
    content: "";
    position: absolute;
    top: 0;
    left: -75%;
    width: 50%;
    height: 100%;
    background: rgba(255, 255, 255, 0.2);
    transform: skewX(-25deg);
    transition: 0.75s;
}

.btn-modern:hover::after {
    left: 125%;
}

/* Responsive */
@media (max-width: 576px) {
    .btn-modern {
        width: 100%;
        font-size: 1rem;
        padding: 0.8rem 1.4rem;
    }
}


/* === FIX MOBILE HORIZONTAL SCROLL === */
html, body {
    overflow-x: hidden !important;
    width: 100%;
}

/* Asegura que el navbar no cree overflow */
.navbar,
.navbar > .container,
.navbar > .container-fluid {
    max-width: 100%;
    overflow-x: clip;
}

/* Evita que cualquier sección se salga del viewport */
section, header, main, footer {
    overflow-x: hidden;
}

/* Corrige margenes laterales que exceden en móviles */
.row {
    margin-left: 0;
    margin-right: 0;
}

/* Si hay paddings extra en hero o navbar */
.hero-section {
    max-width: 100vw;
    overflow-x: hidden;
}

/* Ajuste especial para navbar en pantallas pequeñas */
@media (max-width: 768px) {
    .navbar {
        padding-right: 0 !important;
        padding-left: 0 !important;
    }

        .navbar .container {
            padding-right: 10px;
            padding-left: 10px;
        }
}


/* === FIX DETALLE DE SERVICIOS (CTA OVERLAY) === */
.cta-overlay {
    background: linear-gradient(145deg, #f7f9fc, #e3f0ff);
    border-radius: 12px;
    padding: 1.2rem 1rem;
    text-align: center;
    box-shadow: 0 4px 12px rgba(67, 156, 214, 0.15);
    transition: all 0.3s ease-in-out;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
    color: #1b2559;
    max-width: 100%;
}

    .cta-overlay p {
        font-size: 0.95rem;
        font-weight: 600;
        margin-bottom: 1rem;
        line-height: 1.4;
        color: #1b2559;
        word-break: break-word;
        white-space: normal;
    }

    /* Botón dentro del overlay */
    .cta-overlay a.btn {
        background: linear-gradient(135deg, #263688, #439CD6);
        color: #fff !important;
        border: none;
        border-radius: 50px;
        font-weight: 600;
        transition: all 0.3s ease;
        padding: 0.6rem 1.2rem;
    }

        .cta-overlay a.btn:hover {
            background: linear-gradient(135deg, #1B2559, #3BA6E3);
            transform: translateY(-2px);
            box-shadow: 0 6px 15px rgba(67, 156, 214, 0.3);
        }

/* === Responsive fix for small screens === */
@media (max-width: 576px) {
    .cta-overlay {
        padding: 1rem;
        font-size: 0.9rem;
    }

        .cta-overlay p {
            font-size: 0.9rem;
            line-height: 1.3;
        }

        .cta-overlay a.btn {
            width: 100%;
            font-size: 0.95rem;
        }
}
