/*
 * Agéntica-IA Website Styles
 * Author: Gemini
 * Version: 1.0
 */

/* 1. VARIABLES Y RESET */
:root {
    --primary: #1F4E79;
    --accent: #4DA6FF;
    --neutral-gray: #6E6E6E;
    --white: #FFFFFF;
    --primary-dark: #173B5A;
    --accent-dark: #2F8FE6;
    --text-color: #333;
    --body-bg: #f8f9fa;

    --font-title: 'Montserrat', sans-serif;
    --font-text: 'Roboto', sans-serif;
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-text);
    color: var(--text-color);
    background-color: var(--body-bg);
    line-height: 1.6;
    /* Hide scrollbar for Chrome, Safari and Opera */
    ::-webkit-scrollbar {
        display: none;
    }
    /* Hide scrollbar for IE, Edge and Firefox */
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* 2. UTILIDADES Y COMPONENTES GENERALES */
.container {
    width: 90%;
    max-width: 1100px;
    margin: 0 auto;
}

.section {
    padding: 60px 0;
}

h2, h3, h4 {
    font-family: var(--font-title);
}

.top-spacing h2 {
    margin-top: 50px;
}

h2, h3 {
    color: var(--primary);
}

h2 {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 40px;
}

h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
}

h4 {
    font-size: 1.1rem;
    color: var(--neutral-gray);
    margin-bottom: 10px;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.3s ease;
}

a:hover,
a:focus {
    color: var(--accent-dark);
}

/* Botones */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border-radius: 5px;
    font-weight: bold;
    text-align: center;
    transition: background-color 0.3s ease, color 0.3s ease;
    border: 2px solid transparent;
}

.btn-primary {
    background-color: var(--accent);
    color: var(--white);
}

.btn-primary:hover, .btn-primary:focus {
    background-color: var(--accent-dark);
    color: var(--white);
}

.btn-secondary {
    background-color: transparent;
    color: var(--accent);
    border-color: var(--accent);
}

.btn-secondary:hover, .btn-secondary:focus {
    background-color: var(--accent);
    color: var(--white);
}

/* Accesibilidad */
:focus-visible {
    outline: 3px solid var(--accent-dark);
    outline-offset: 2px;
}

/* 3. HEADER Y NAVEGACIÓN */
#header {
    background-color: var(--white);
    padding: 10px 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: background-color 0.3s ease;
}

#header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    height: 60px;
    width: auto;
}

.nav-toggle {
    display: none;
}

.nav-menu {
    list-style: none;
    display: flex;
    align-items: center;
}

.nav-menu li {
    margin: 0 15px;
}

.nav-menu a {
    color: var(--primary);
    font-weight: bold;
    padding: 5px 0;
    border-bottom: 2px solid transparent;
    transition: color 0.3s ease, border-bottom-color 0.3s ease;
}

.nav-menu a:hover,
.nav-menu a:focus,
.nav-menu a.active {
    border-bottom-color: var(--accent);
    color: var(--accent);
}

/* 4. HERO SECTION */
.hero {
    background: url('../assets/hero-bg.webp') no-repeat center center/cover;
    background-color: var(--primary);
    color: var(--white);
    text-align: center;
    padding: 180px 0 100px;
    position: relative;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(31, 78, 121, 0.7);
}

.hero .container {
    position: relative;
    z-index: 2;
}

.hero h1 {
    font-family: var(--font-title);
    font-size: 3rem;
    margin-bottom: 20px;
}

.hero .slogan {
    font-size: 1.5rem;
    color: var(--accent);
    margin-bottom: 20px;
    font-weight: bold;
}

.hero p {
    max-width: 800px;
    margin: 0 auto 30px;
}

.cta-buttons .btn {
    margin: 0 10px;
}

/* 5. OTRAS SECCIONES */

/* Sobre Nosotros y Contacto (Split layout) */
.content-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.content-split .image-content img {
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

/* Servicios y Noticias (Grid layout) */
.grid-4, .grid-3, .grid-2 {
    display: grid;
    gap: 30px;
}

.grid-4 { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); }

.card {
    background-color: var(--white);
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

#servicios .card img {
    width: 90%;
    height: 180px;
    margin: 10px auto;
    border-radius: 10px;
}

.card-content, #servicios .card h3, #servicios .card h4, #servicios .card p, #servicios .card .btn {
    padding: 0 20px;
}

#servicios .card .btn {
    margin-left: 20px;
    margin-right: 20px;
}

#servicios .card h3, #servicios .card h4, #servicios .card p {
    margin-bottom: 15px;
}

#servicios .card .btn {
    margin-top: auto;
    margin-bottom: 20px;
}

#noticias .card-content {
    padding: 20px;
}

#noticias .date {
    font-size: 0.9rem;
    color: var(--neutral-gray);
    margin-bottom: 10px;
}

#noticias .card a {
    font-weight: bold;
}

/* Contacto Form */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-family: inherit;
}

.form-group-checkbox {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.form-group-checkbox input {
    margin-right: 10px;
}

.social-links a {
    margin-right: 15px;
    color: var(--primary);
}

.social-links svg {
    width: 30px;
    height: 30px;
}

/* 6. FOOTER */
footer {
    background-color: var(--white);
    color: var(--primary);
    padding: 30px 0;
    text-align: center;
    border-top: 1px solid #eee;
}

footer .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

footer .logo {
    height: 50px;
}

.footer-links a {
    color: var(--primary);
    margin: 0 10px;
}

/* 8. ARTICLE PAGE */
.article-page {
    padding-top: 120px;
}

.article-page h1 {
    font-size: 2.8rem;
    margin-bottom: 20px;
}

.article-page .date {
    font-size: 1rem;
    color: var(--neutral-gray);
    margin-bottom: 30px;
}

.article-image {
    width: 100%;
    height: auto;
    max-height: 400px;
    object-fit: contain;
    border-radius: 10px;
    margin-bottom: 40px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    background-color: #FFFFFF;
}

.article-content p {
    margin-bottom: 20px;
    font-size: 1.1rem;
    line-height: 1.7;
}

.article-content h3 {
    margin-bottom: 10px;
    margin-top: 10px;
}

.article-content ul, .article-content ol {
    margin-left: 25px;
    margin-bottom: 20px;
}

/* 9. IMPLEMENTATION STEPS */
.hero-small {
    background-color: var(--primary);
    color: var(--white);
    padding: 3rem 0;
    text-align: center;
}
.hero-small h2 {
    font-size: 2.5rem;
    font-family: var(--font-title);
    color: var(--white);
    margin-bottom: 0px;
}

.hero-small p {
    font-size: 1.2rem;
    font-family: var(--font-text);
    font-style: italic;
    color: var(--white);
    margin: 5px 0;
}

#implementacion-ia h2 {
    text-align: center;
    margin-bottom: 3rem;
}
.implementation-steps .step {
    display: flex;
    align-items: center;
    margin-bottom: 3rem;
    gap: 2rem;
}
.implementation-steps .step:nth-child(even) {
    flex-direction: row-reverse;
}
.implementation-steps .step-image {
    flex: 1;
    min-height: 250px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.implementation-steps .step-image img {
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.implementation-steps .step-content {
    flex: 2;
}
.implementation-steps .step-content h3 {
    font-family: var(--font-title);
    color: var(--primary);
    margin-bottom: 1rem;
}

/* 10. CTA SECTION */
.cta-section {
    text-align: center;
    background-color: var(--body-bg);
}

.cta-section .btn {
    font-size: 1.2rem;
    padding: 15px 30px;
}

/* 11. RECAPTCHA */
.grecaptcha-badge {
    visibility: hidden;
}

.recaptcha-notice {
    font-size: 0.8rem;
    color: var(--neutral-gray);
    margin-top: 15px;
}

.recaptcha-notice a {
    color: var(--neutral-gray);
    text-decoration: underline;
}

.recaptcha-notice a:hover {
    color: var(--primary);
}

/* 7. MEDIA QUERIES (Mobile First) */
@media (max-width: 768px) {
    h2 { font-size: 2rem; }
    .hero h1 { font-size: 2.2rem; }
    .hero .btn {margin-bottom: 1rem;}

    #header .container {
        flex-wrap: wrap;
    }

    #header .btn {
        display: none; /* Ocultar botón 'Hablemos' en móvil */
    }

    .nav-toggle {
        display: block;
        background: transparent;
        border: 0;
        cursor: pointer;
        padding: 10px;
        position: absolute;
        right: 15px;
        top: 15px;
        z-index: 1001;
    }

    .hamburger {
        display: block;
        position: relative;
        width: 25px;
        height: 3px;
        background: var(--primary);
        transition: transform 0.3s ease;
    }

    .hamburger::before,
    .hamburger::after {
        content: '';
        position: absolute;
        left: 0;
        width: 100%;
        height: 3px;
        background: var(--primary);
        transition: transform 0.3s ease, top 0.3s ease, bottom 0.3s ease;
    }

    .hamburger::before {
        top: -8px;
    }

    .hamburger::after {
        bottom: -8px;
    }

    .nav-menu {
        flex-direction: column;
        width: 100%;
        text-align: center;
        display: none; /* Oculto por defecto */
        margin-top: 10px;
        background-color: var(--white);
        position: absolute;
        top: 70px;
        left: 0;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu li {
        margin: 10px 0;
    }

    .content-split {
        grid-template-columns: 1fr;
    }

    .content-split .image-content {
        order: -1; /* Imagen arriba en móvil */
    }

    .implementation-steps .step {
        flex-direction: column;
    }

    .implementation-steps .step:nth-child(even) {
        flex-direction: column; /* Ensure all steps are column on mobile */
    }

    .implementation-steps .step-image {
        margin-bottom: 1rem; /* Add some space below the image */
    }

    .implementation-steps .step-image img {
        width: 100%; /* Ensure image takes full width of its container */
        height: auto;
    }

    .nav-open .hamburger {
        transform: rotate(45deg);
    }

    .nav-open .hamburger::before {
        top: 0;
        transform: rotate(90deg);
    }

    .nav-open .hamburger::after {
        bottom: 0;
        transform: rotate(90deg);
    }
}

/* About page styles */
.team-section {
    padding: 60px 0;
}
.team-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 50px;
    margin-top: 40px;
}
.team-member {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 30px;
    align-items: flex-start;
}
.team-member img {
    width: 200px;
    height: 200px;
    object-fit: cover;
    border-radius: 10px; /* Changed from 50% to 10px for rounded corners */
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.team-member-info h3 {
    font-size: 1.8rem;
    color: var(--primary);
    margin-bottom: 10px;
}
.team-member-info p {
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 15px;
}

@media (max-width: 768px) {
    .team-member {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .team-member img {
        margin: 0 auto 20px;
    }
}

/* News page */
.article-page p {
    margin-bottom: 20px;
    font-size: 1.1rem;
    line-height: 1.7;
}

.article-page ul {
    margin-left: 25px;
    margin-bottom: 20px;
}

.article-page ol {
    margin-left: 25px;
    margin-bottom: 20px;
}

.article-page li {
    margin-bottom: 10px;
}

.article-page hr {
    margin-bottom: 10px;
    margin-top: 10px;
}

.article-page a{
    font-weight: normal;
    color: var(--neutral-gray);
}
/* Contact page */