/**
 * Efectos Profesionales para la Sección Departamentos
 * Animaciones suaves, transiciones elegantes y efectos modernos
 */

/* ============================================
   TABS/PESTAÑAS CON EFECTOS
   ============================================ */

.departments .nav-tabs {
    border: none;
    gap: 10px;
}

.departments .nav-tabs .nav-item {
    margin-bottom: 0;
}

.departments .nav-tabs .nav-link {
    border: none;
    border-radius: 8px;
    padding: 15px 20px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #495057;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Efecto de onda al hover */
.departments .nav-tabs .nav-link::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(25, 119, 204, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.departments .nav-tabs .nav-link:hover::before {
    width: 300px;
    height: 300px;
}

.departments .nav-tabs .nav-link:hover {
    transform: translateX(8px);
    box-shadow: 0 4px 15px rgba(25, 119, 204, 0.2);
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

/* Tab activo */
.departments .nav-tabs .nav-link.active {
    background: linear-gradient(135deg, #1977cc 0%, #2d7ab8 100%);
    color: white;
    transform: translateX(8px) scale(1.02);
    box-shadow: 0 8px 20px rgba(25, 119, 204, 0.3);
}

.departments .nav-tabs .nav-link.active::after {
    content: '→';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    animation: arrowBounce 1s ease-in-out infinite;
}

@keyframes arrowBounce {
    0%, 100% { transform: translateY(-50%) translateX(0); }
    50% { transform: translateY(-50%) translateX(5px); }
}

/* ============================================
   CONTENIDO DEL TAB CON ANIMACIONES
   ============================================ */

.departments .tab-content {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

/* Animación de entrada del contenido */
.departments .tab-pane {
    opacity: 0;
    transform: translateY(20px);
    transition: none;
}

.departments .tab-pane.active {
    animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   TÍTULOS CON EFECTOS
   ============================================ */

.departments .tab-pane h3 {
    font-size: 2rem;
    font-weight: 700;
    color: #1977cc;
    margin-bottom: 15px;
    position: relative;
    padding-bottom: 15px;
    animation: titleSlideIn 0.8s ease 0.2s backwards;
}

/* Línea decorativa bajo el título */
.departments .tab-pane h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 3px;
    background: linear-gradient(90deg, #1977cc 0%, #87CEFA 100%);
    animation: lineExpand 0.8s ease 0.4s forwards;
}

@keyframes titleSlideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes lineExpand {
    from { width: 0; }
    to { width: 80px; }
}

/* Subtítulo con efecto de escritura */
.departments .tab-pane .font-italic {
    font-size: 1.1rem;
    color: #6c757d;
    margin-bottom: 20px;
    animation: fadeIn 1s ease 0.4s backwards;
    position: relative;
    padding-left: 20px;
}

.departments .tab-pane .font-italic::before {
    content: '"';
    position: absolute;
    left: 0;
    top: -5px;
    font-size: 2rem;
    color: #1977cc;
    opacity: 0.3;
}

/* Descripción con fade in */
.departments .tab-pane p:not(.font-italic) {
    line-height: 1.8;
    color: #495057;
    animation: fadeIn 1s ease 0.6s backwards;
}

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

/* ============================================
   IMAGEN CON EFECTOS PROFESIONALES
   ============================================ */

.departments .tab-pane img {
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    animation: imageZoomIn 0.8s ease 0.3s backwards;
    position: relative;
    overflow: hidden;
}

/* Efecto de zoom y elevación al cargar */
@keyframes imageZoomIn {
    from {
        opacity: 0;
        transform: scale(0.8) rotate(-5deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* Hover en la imagen */
.departments .tab-pane img:hover {
    transform: scale(1.05) translateY(-5px);
    box-shadow: 0 20px 40px rgba(25, 119, 204, 0.3);
}

/* Efecto de brillo que se mueve sobre la imagen */
.departments .tab-pane .text-center {
    position: relative;
    overflow: hidden;
}

.departments .tab-pane .text-center::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        45deg,
        transparent 30%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 70%
    );
    transform: rotate(45deg);
    animation: shine 3s ease-in-out infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

/* ============================================
   EFECTOS RESPONSIVE
   ============================================ */

@media (max-width: 992px) {
    .departments .nav-tabs .nav-link {
        padding: 12px 15px;
        font-size: 0.95rem;
    }
    
    .departments .tab-pane h3 {
        font-size: 1.5rem;
    }
    
    .departments .tab-content {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .departments .nav-tabs {
        margin-bottom: 20px;
    }
    
    .departments .nav-tabs .nav-link:hover {
        transform: translateX(0) scale(1.02);
    }
    
    .departments .nav-tabs .nav-link.active {
        transform: scale(1.02);
    }
}

/* ============================================
   EFECTOS ADICIONALES - PARTÍCULAS DECORATIVAS
   ============================================ */

.departments .tab-content::before,
.departments .tab-content::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(25, 119, 204, 0.1), rgba(135, 206, 250, 0.1));
    animation: float 6s ease-in-out infinite;
    z-index: 0;
}

.departments .tab-content::before {
    width: 200px;
    height: 200px;
    top: -100px;
    right: -100px;
}

.departments .tab-content::after {
    width: 150px;
    height: 150px;
    bottom: -75px;
    left: -75px;
    animation-delay: 3s;
}

@keyframes float {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-20px) rotate(180deg); }
}

/* Asegurar que el contenido esté por encima de las partículas */
.departments .tab-pane .row {
    position: relative;
    z-index: 1;
}
