/* ===== Reset y Estilos Base ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== Header y Navegación ===== */
.header {
    background-color: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
}

.nav-logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: #2c3e50;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
}

.nav-link {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s;
}

.nav-link:hover {
    color: #3498db;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
}

.bar {
    width: 25px;
    height: 3px;
    background-color: #333;
    margin: 3px 0;
    transition: 0.3s;
}

/* ===== Secciones Generales ===== */
.section {
    padding: 80px 0;
    margin-top: 70px;
}

.section:nth-child(even) {
    background-color: #fff;
}

.section h2 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 3rem;
    color: #2c3e50;
}

/* ===== Sección Inicio ===== */
.section-inicio {
    min-height: 100vh;
    display: flex;
    align-items: center;
    text-align: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

.hero-image {
    max-width: 100%;
    width: 100%;
    height: auto;
    margin: 2rem auto;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
    display: block;
}

.logos-image {
    max-width: 100%;
    width: 100%;
    height: auto;
    margin-top: 3rem;
    opacity: 0.9;
    display: block;
}

/* ===== Sección Objetivo ===== */
.objetivo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.objetivo-card {
    background: #fff;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.objetivo-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.objetivo-card h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

/* ===== Sección Desarrollo ===== */
.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto 4rem;
}

.timeline::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    width: 2px;
    height: 100%;
    background: #3498db;
    transform: translateX(-50%);
}

.timeline-item {
    position: relative;
    margin-bottom: 3rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    top: 30px;
    left: 50%;
    width: 20px;
    height: 20px;
    background: #3498db;
    border-radius: 50%;
    transform: translateX(-50%);
    border: 4px solid #fff;
    box-shadow: 0 0 0 4px #3498db;
}

.timeline-content {
    background: #fff;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    width: calc(50% - 40px);
    position: relative;
}

.timeline-item:nth-child(odd) .timeline-content {
    left: calc(50% + 20px);
}

.timeline-item:nth-child(even) .timeline-content {
    left: 0;
}

.timeline-content h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
}

.timeline-content p {
    color: #e74c3c;
    margin-bottom: 1rem;
}

.timeline-content ul {
    list-style: none;
}

.timeline-content li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
}

.timeline-content li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #27ae60;
    font-weight: bold;
}

/* Galería */
.gallery-section {
    margin-top: 4rem;
}

.gallery-section h3 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: #2c3e50;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s;
}

.gallery-item:hover {
    transform: scale(1.05);
}

.gallery-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

.gallery-caption {
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 0.5rem;
    text-align: center;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0;
    transform: translateY(100%);
    transition: transform 0.3s;
}

.gallery-item:hover .gallery-caption {
    transform: translateY(0);
}

.gallery-image-loading {
    opacity: 0;
}

/* ===== Modal Styles ===== */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    margin: auto;
    display: block;
    width: 90%;
    max-width: 1200px;
    max-height: 90vh;
    object-fit: contain;
    animation: zoomIn 0.3s ease;
    border-radius: 5px;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.modal-caption {
    margin: auto;
    display: block;
    width: 90%;
    max-width: 1200px;
    text-align: center;
    color: #fff;
    padding: 20px 0 0;
    font-size: 1.2rem;
}

.modal-close {
    position: absolute;
    top: 30px;
    right: 45px;
    color: #fff;
    font-size: 60px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
    z-index: 2001;
}

.modal-close:hover {
    color: #3498db;
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 60px;
    font-weight: bold;
    cursor: pointer;
    background-color: rgba(0, 0, 0, 0.5);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
    z-index: 2001;
    user-select: none;
}

.modal-nav:hover {
    background-color: rgba(0, 0, 0, 0.8);
    color: #3498db;
}

.modal-prev {
    left: 30px;
}

.modal-next {
    right: 30px;
}

/* Responsive adjustments for modal */
@media only screen and (max-width: 800px) {
    .modal-content {
        width: 95%;
        max-height: 85vh;
    }

    .modal-caption {
        font-size: 1rem;
        padding: 15px 0 0;
    }

    .modal-close {
        top: 15px;
        right: 25px;
        font-size: 40px;
    }

    .modal-nav {
        width: 40px;
        height: 40px;
        font-size: 30px;
    }

    .modal-prev {
        left: 15px;
    }

    .modal-next {
        right: 15px;
    }
}

/* ===== Sección Resultados ===== */
.resultados-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 4rem;
}

.resultado-item {
    background: #fff;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    border-left: 5px solid #27ae60;
}

.resultado-item h3 {
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.metrics-section {
    margin-top: 3rem;
}

.metrics-section h3 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: #2c3e50;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
}

.metric-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    padding: 2rem;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.metric-number {
    display: block;
    font-size: 3rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.metric-label {
    font-size: 1rem;
    opacity: 0.9;
}

/* ===== Sección Documentación ===== */
.doc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.doc-card {
    background: #fff;
    padding: 2rem;
    border-radius: 10px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: transform 0.3s, box-shadow 0.3s;
}

.doc-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.doc-card h3 {
    color: #2c3e50;
    margin-bottom: 1rem;
    font-size: 1.3rem;
}

.doc-card p {
    margin-bottom: 1rem;
}

.doc-link {
    display: inline-block;
    background: #3498db;
    color: #fff;
    padding: 0.5rem 1.5rem;
    border-radius: 5px;
    text-decoration: none;
    transition: background 0.3s;
}

.doc-link:hover {
    background: #2980b9;
}

.doc-list {
    list-style: none;
    margin-top: 1rem;
}

.doc-list li {
    margin-bottom: 0.5rem;
}

.doc-list a {
    color: #3498db;
    text-decoration: none;
}

.doc-list a:hover {
    text-decoration: underline;
}

/* ===== Footer ===== */
.footer {
    background-color: #2c3e50;
    color: #fff;
    padding: 2rem 0;
    text-align: center;
}

.footer p {
    margin-bottom: 1.5rem;
}

.footer-logo {
    max-width: 300px;
    width: 100%;
    height: auto;
    margin: 0 auto;
    opacity: 0.8;
    transition: opacity 0.3s ease;
}

.footer-logo:hover {
    opacity: 1;
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: #fff;
        width: 100%;
        text-align: center;
        transition: 0.3s;
        box-shadow: 0 10px 27px rgba(0,0,0,0.05);
        padding: 2rem 0;
    }

    .nav-menu.active {
        left: 0;
    }

    .nav-toggle {
        display: flex;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .section h2 {
        font-size: 2rem;
    }

    .timeline::before {
        left: 30px;
    }

    .timeline-item::before {
        left: 30px;
    }

    .timeline-content {
        width: calc(100% - 60px);
        left: 60px !important;
    }

    .gallery-grid {
        grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    }

    .resultados-grid,
    .doc-grid {
        grid-template-columns: 1fr;
    }

    .metrics-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .metric-number {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .section {
        padding: 60px 0;
    }

    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .objetivo-card,
    .doc-card,
    .resultado-item {
        padding: 1.5rem;
    }
}