/* ====== HISTORIA - ESTILOS COMPLETOS ====== */

/* Variables de color consistentes */
:root {
    --primary-teal: #00bec6ff;
    --primary-teal-dark: #009aa0;
    --primary-blue: #004063ff;
    --primary-blue-light: #e8f4f8;
    --bg-light: #f8f9fa;
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md: 0 8px 25px rgba(0, 0, 0, 0.10);
    --shadow-lg: 0 15px 40px rgba(0, 0, 0, 0.15);
    --border-radius: 14px;
    --border-radius-sm: 10px;
    --transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ====== CARRUSEL ====== */
.carousel-section {
    background: var(--bg-light);
    padding: 50px 0 60px;
}

.carousel-section .container {
    max-width: 1100px;
}

#historyCarousel {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

#historyCarousel .carousel-inner {
    border-radius: var(--border-radius);
}

.carousel-item img {
    height: 480px;
    object-fit: cover;
    width: 100%;
}

/* Indicadores del carrusel */
.carousel-indicators {
    bottom: 20px;
}

.carousel-indicators button {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    margin: 0 6px;
    background: rgba(255,255,255,0.5);
    transition: var(--transition);
}

.carousel-indicators button.active {
    background: var(--primary-teal);
    transform: scale(1.2);
}

.carousel-indicators button:hover {
    background: rgba(255,255,255,0.8);
}

/* Controles del carrusel */
.carousel-control-prev,
.carousel-control-next {
    width: 50px;
    height: 50px;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.3);
    border-radius: 50%;
    opacity: 0;
    transition: var(--transition);
}

#historyCarousel:hover .carousel-control-prev,
#historyCarousel:hover .carousel-control-next {
    opacity: 1;
}

.carousel-control-prev {
    left: 15px;
}

.carousel-control-next {
    right: 15px;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
    width: 20px;
    height: 20px;
}

/* Caption del carrusel */
.carousel-caption {
    background: linear-gradient(0deg, rgba(0,0,0,0.7) 0%, transparent 100%);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    padding: 30px 25px 20px;
    bottom: 0;
    left: 0;
    right: 0;
    text-align: left;
}

.carousel-caption h5 {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 5px;
    color: white;
}

.carousel-caption p {
    font-size: 0.95rem;
    opacity: 0.9;
    margin-bottom: 0;
}

/* ====== SECCIÓN DE HISTORIA ====== */
.history-section {
    padding: 70px 0 80px;
    background: white;
}

.history-header {
    text-align: center;
    margin-bottom: 50px;
}

.history-header h1 {
    color: var(--primary-blue);
    font-weight: 700;
    font-size: 2.5rem;
    margin-bottom: 15px;
    position: relative;
    display: inline-block;
}

.history-header h1::after {
    content: '';
    display: block;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-teal), var(--primary-blue));
    margin: 12px auto 0;
    border-radius: 2px;
}

.history-header p {
    color: #6c757d;
    font-size: 1.1rem;
    max-width: 750px;
    margin: 15px auto 0;
    line-height: 1.7;
}

/* ====== LÍNEA DE TIEMPO ====== */
.timeline {
    position: relative;
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px 0;
}

/* Línea vertical */
.timeline::after {
    content: '';
    position: absolute;
    width: 4px;
    background: linear-gradient(180deg, var(--primary-teal), var(--primary-blue));
    top: 0;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    border-radius: 4px;
}

.timeline-item {
    padding: 10px 40px 10px 40px;
    position: relative;
    width: 50%;
    box-sizing: border-box;
    margin-bottom: 30px;
}

/* Círculo conector */
.timeline-item::after {
    content: '';
    position: absolute;
    width: 22px;
    height: 22px;
    background: white;
    border: 4px solid var(--primary-teal);
    border-radius: 50%;
    top: 20px;
    z-index: 2;
    transition: var(--transition);
    box-shadow: 0 0 0 4px rgba(0, 190, 198, 0.15);
}

.timeline-item:hover::after {
    background: var(--primary-teal);
    box-shadow: 0 0 0 8px rgba(0, 190, 198, 0.2);
    transform: scale(1.1);
}

/* Item izquierdo */
.timeline-item.left {
    left: 0;
    padding-right: 50px;
    text-align: right;
}

.timeline-item.left::after {
    right: -11px;
}

/* Item derecho */
.timeline-item.right {
    left: 50%;
    padding-left: 50px;
    text-align: left;
}

.timeline-item.right::after {
    left: -11px;
}

/* Contenido de la línea de tiempo */
.timeline-content {
    padding: 25px 30px;
    background: white;
    border-radius: var(--border-radius-sm);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border: 1px solid rgba(0,0,0,0.03);
    position: relative;
}

.timeline-content:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-teal);
}

/* Flecha decorativa */
.timeline-item.left .timeline-content::after {
    content: '';
    position: absolute;
    right: -8px;
    top: 22px;
    width: 16px;
    height: 16px;
    background: white;
    transform: rotate(45deg);
    border-right: 1px solid rgba(0,0,0,0.03);
    border-top: 1px solid rgba(0,0,0,0.03);
}

.timeline-item.right .timeline-content::after {
    content: '';
    position: absolute;
    left: -8px;
    top: 22px;
    width: 16px;
    height: 16px;
    background: white;
    transform: rotate(45deg);
    border-left: 1px solid rgba(0,0,0,0.03);
    border-bottom: 1px solid rgba(0,0,0,0.03);
}

.timeline-content h2 {
    color: var(--primary-teal);
    font-size: 1.3rem;
    font-weight: 700;
    margin-top: 0;
    margin-bottom: 10px;
}

.timeline-content p {
    color: #495057;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 0;
}

/* Badge de año */
.timeline-year-badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 14px;
    border-radius: 20px;
    background: var(--primary-blue-light);
    color: var(--primary-blue);
    margin-bottom: 8px;
    letter-spacing: 0.5px;
}

/* ====== SECCIÓN DE IMPACTO ====== */
.impact-section {
    padding: 70px 0 80px;
    background: var(--bg-light);
}

.impact-section .history-header h1 {
    color: var(--primary-blue);
}

.impact-section .history-header p {
    color: #6c757d;
}

/* Cards de impacto */
.impact-card {
    border: none;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    height: 100%;
    background: white;
    border: 1px solid rgba(0,0,0,0.03);
}

.impact-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-teal);
}

.impact-card img {
    height: 220px;
    object-fit: cover;
    width: 100%;
    transition: var(--transition);
}

.impact-card:hover img {
    transform: scale(1.03);
}

.impact-card .card-body {
    padding: 25px 28px 30px;
}

.impact-card h3 {
    color: var(--primary-teal);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.impact-card p {
    color: #6c757d;
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 0;
}

/* Icono decorativo en la card */
.impact-card .card-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-blue-light);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    color: var(--primary-teal);
    font-size: 1.5rem;
    transition: var(--transition);
}

.impact-card:hover .card-icon {
    background: var(--primary-teal);
    color: white;
    transform: scale(1.1);
}

/* ====== RESPONSIVE ====== */

/* Tablets */
@media (max-width: 992px) {
    .carousel-item img {
        height: 380px;
    }
    
    .carousel-caption h5 {
        font-size: 1.1rem;
    }
    
    .carousel-caption p {
        font-size: 0.85rem;
    }
    
    .history-header h1 {
        font-size: 2rem;
    }
    
    .history-header p {
        font-size: 1rem;
        padding: 0 15px;
    }
    
    .impact-card img {
        height: 180px;
    }
}

/* Móviles grandes */
@media (max-width: 768px) {
    .carousel-section {
        padding: 30px 0 40px;
    }
    
    .carousel-item img {
        height: 280px;
    }
    
    .carousel-control-prev,
    .carousel-control-next {
        width: 35px;
        height: 35px;
        opacity: 0.6;
    }
    
    .carousel-control-prev {
        left: 8px;
    }
    
    .carousel-control-next {
        right: 8px;
    }
    
    .carousel-caption {
        padding: 15px 15px 12px;
    }
    
    .carousel-caption h5 {
        font-size: 0.95rem;
    }
    
    .carousel-caption p {
        font-size: 0.75rem;
        display: none;
    }
    
    .history-section {
        padding: 40px 0 50px;
    }
    
    .history-header h1 {
        font-size: 1.7rem;
    }
    
    .history-header p {
        font-size: 0.9rem;
    }
    
    /* Línea de tiempo móvil */
    .timeline::after {
        left: 20px;
    }
    
    .timeline-item {
        width: 100%;
        padding-left: 50px;
        padding-right: 15px;
        text-align: left !important;
        margin-bottom: 25px;
    }
    
    .timeline-item.left {
        left: 0;
        padding-right: 15px;
        text-align: left !important;
    }
    
    .timeline-item.right {
        left: 0;
        padding-left: 50px;
        text-align: left !important;
    }
    
    .timeline-item::after {
        left: 9px;
        width: 18px;
        height: 18px;
        top: 18px;
    }
    
    .timeline-item.left::after {
        right: auto;
        left: 9px;
    }
    
    .timeline-item.right::after {
        left: 9px;
    }
    
    .timeline-content {
        padding: 18px 20px;
    }
    
    .timeline-content h2 {
        font-size: 1.1rem;
    }
    
    .timeline-content p {
        font-size: 0.85rem;
    }
    
    /* Flechas en móvil */
    .timeline-item.left .timeline-content::after,
    .timeline-item.right .timeline-content::after {
        display: none;
    }
    
    .impact-section {
        padding: 40px 0 50px;
    }
    
    .impact-card img {
        height: 160px;
    }
    
    .impact-card .card-body {
        padding: 20px 20px 25px;
    }
    
    .impact-card h3 {
        font-size: 1.05rem;
    }
    
    .impact-card p {
        font-size: 0.85rem;
    }
}

/* Móviles pequeños */
@media (max-width: 576px) {
    .carousel-section {
        padding: 20px 0 30px;
    }
    
    .carousel-item img {
        height: 220px;
    }
    
    .carousel-indicators button {
        width: 8px;
        height: 8px;
        margin: 0 4px;
    }
    
    .carousel-control-prev,
    .carousel-control-next {
        width: 28px;
        height: 28px;
    }
    
    .carousel-control-prev-icon,
    .carousel-control-next-icon {
        width: 14px;
        height: 14px;
    }
    
    .history-section {
        padding: 30px 0 40px;
    }
    
    .history-header {
        margin-bottom: 30px;
    }
    
    .history-header h1 {
        font-size: 1.4rem;
    }
    
    .history-header h1::after {
        width: 50px;
        height: 3px;
    }
    
    .history-header p {
        font-size: 0.85rem;
        padding: 0 10px;
    }
    
    .timeline-item {
        padding-left: 40px;
        padding-right: 10px;
        margin-bottom: 20px;
    }
    
    .timeline-item.right {
        padding-left: 40px;
    }
    
    .timeline-item::after {
        left: 6px;
        width: 14px;
        height: 14px;
        border-width: 3px;
        top: 15px;
    }
    
    .timeline-item.left::after {
        left: 6px;
    }
    
    .timeline-item.right::after {
        left: 6px;
    }
    
    .timeline-content {
        padding: 15px 16px;
        border-radius: 8px;
    }
    
    .timeline-content h2 {
        font-size: 0.95rem;
    }
    
    .timeline-content p {
        font-size: 0.8rem;
    }
    
    .timeline-year-badge {
        font-size: 0.6rem;
        padding: 1px 10px;
    }
    
    .impact-section {
        padding: 30px 0 40px;
    }
    
    .impact-card {
        border-radius: var(--border-radius-sm);
        margin-bottom: 20px;
    }
    
    .impact-card img {
        height: 140px;
    }
    
    .impact-card .card-body {
        padding: 16px 16px 20px;
    }
    
    .impact-card h3 {
        font-size: 0.95rem;
    }
    
    .impact-card p {
        font-size: 0.8rem;
    }
}

/* Móviles muy pequeños */
@media (max-width: 400px) {
    .carousel-item img {
        height: 180px;
    }
    
    .carousel-caption h5 {
        font-size: 0.8rem;
    }
    
    .history-header h1 {
        font-size: 1.2rem;
    }
    
    .timeline-item {
        padding-left: 35px;
        padding-right: 8px;
    }
    
    .timeline-item.right {
        padding-left: 35px;
    }
    
    .timeline-item::after {
        width: 12px;
        height: 12px;
        left: 5px;
        top: 12px;
    }
    
    .timeline-item.left::after {
        left: 5px;
    }
    
    .timeline-item.right::after {
        left: 5px;
    }
    
    .timeline-content {
        padding: 12px 14px;
    }
    
    .timeline-content h2 {
        font-size: 0.85rem;
    }
    
    .timeline-content p {
        font-size: 0.75rem;
    }
}