@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@300;400;500;600;700&family=Open+Sans:wght@300;400;600&display=swap');

:root {
  --primary-blue: #2d81f1;
  --primary-blue-dark: #171a4a;
  --secondary-accent: #00d2ff;
  --white: #ffffff;
  --light-gray: #f8f9fa;
  --medium-gray: #6c757d;
  --dark-gray: #343a40;
  --transition-fast: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Open Sans', sans-serif;
  line-height: 1.7;
  color: var(--dark-gray);
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 600;
}

/* NAVBAR STYLES - MODERN & PREMIUM */
.navbar-custom {
  background: linear-gradient(to right, var(--primary-blue-dark), #1a237e);
  /* Degrade sutil */
  padding: 1rem 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  /* Efecto vidrio si hay transparencia */
}

@media (max-width: 991px) {
  .navbar-custom {
    padding: 0.5rem 0;
  }

  .navbar-collapse {
    background-color: var(--primary-blue-dark);
    margin-top: 10px;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    text-align: center;
  }

  .navbar-nav .nav-link {
    padding: 10px 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  }

  .navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.05);
  }

  /* Centrar dropdowns en movil */
  .dropdown-menu {
    text-align: center;
    background-color: rgba(255, 255, 255, 0.95);
    border: none;
    box-shadow: none;
    margin-top: 5px !important;
  }

  .nav-item.dropdown .dropdown-menu::before {
    display: none;
    /* remove arrow on mobile */
  }
}

/* Scrolled state (can be toggled with JS if needed, but styling here for robust default) */
.navbar-custom.scrolled {
  padding: 10px 0;
  background: rgba(23, 26, 74, 0.98);
}

.navbar-brand {
  color: var(--white) !important;
  font-weight: 700;
  font-size: 1.5rem;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  transition: transform 0.3s ease;
}

.navbar-brand:hover {
  transform: scale(1.02);
}

.navbar-brand img {
  height: 45px;
  width: auto;
  margin-right: 12px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.navbar-nav {
  align-items: center;
  /* Centrar items verticalmente */
}

.navbar-nav .nav-link {
  color: rgba(255, 255, 255, 0.9) !important;
  font-weight: 500;
  font-size: 0.95rem;
  padding: 0.5rem 1rem !important;
  margin: 0 2px;
  border-radius: 5px;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active,
.navbar-nav .nav-link.show {
  color: var(--white) !important;
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-1px);
}

/* Efecto de subrayado animado */
.navbar-nav .nav-link::after {
  content: '';
  position: absolute;
  bottom: 0px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 2px;
  background-color: var(--secondary-accent);
  transition: width 0.3s ease;
  border-radius: 2px;
}

.navbar-nav .nav-link:hover::after {
  width: 80%;
}

.navbar-nav .nav-link i {
  color: var(--secondary-accent) !important;
  /* Iconos en color acento */
  transition: color 0.3s;
}

.navbar-nav .nav-link:hover i {
  color: var(--white) !important;
}

/* Dropdown Menu - Modernizado */
.dropdown-menu {
  background-color: var(--white);
  border: none;
  border-radius: 12px;
  padding: 8px;
  margin-top: 15px !important;
  /* Separación del navbar */
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  animation: fadeIn 0.3s ease;
  min-width: 220px;
}

/* Triangulito superior del dropdown */
.nav-item.dropdown .dropdown-menu::before {
  content: '';
  position: absolute;
  top: -6px;
  left: 20px;
  width: 12px;
  height: 12px;
  background-color: var(--white);
  transform: rotate(45deg);
  box-shadow: -2px -2px 5px rgba(0, 0, 0, 0.05);
}

.dropdown-item {
  color: var(--dark-gray) !important;
  font-weight: 500;
  font-size: 0.9rem;
  padding: 10px 15px;
  border-radius: 8px;
  transition: all 0.2s;
  display: flex;
  align-items: center;
}

.dropdown-item:hover {
  background-color: #f0f7ff;
  /* Azul muy muy claro */
  color: var(--primary-blue) !important;
  transform: translateX(5px);
}

.dropdown-item i {
  color: var(--primary-blue) !important;
  /* Iconos internos azules */
  width: 20px;
  text-align: center;
  margin-right: 10px;
}

.dropdown-divider {
  margin: 0.5rem 0;
  border-top: 1px solid #e9ecef;
}

.navbar-toggler {
  border: none;
  padding: 0.5rem;
  transition: transform 0.3s;
}

.navbar-toggler:focus {
  box-shadow: none;
  outline: none;
  transform: rotate(90deg);
}

.navbar-toggler-icon {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 1%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='3' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* CAROUSEL STYLES - ACTUALIZADO CON COLORES AZULES */
.hero-carousel {
  margin-bottom: 30px;
}

.hero-carousel .carousel-item {
  height: 500px;
  position: relative;
}

.carousel-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.carousel-caption {
  padding: 30px;
  max-width: 600px;
  margin: 0 auto;
  bottom: 100px;
}

.carousel-caption h3 {
  font-size: 2.5rem;
  font-weight: 300;
  margin-bottom: 20px;
  color: var(--white);
}

.carousel-caption p {
  font-size: 1.1rem;
  margin-bottom: 20px;
}

.carousel-control-prev,
.carousel-control-next {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(23, 26, 74, 0.6);
  /* Cambiado a azul oscuro */
  top: 50%;
  transform: translateY(-50%);
  opacity: 0.8;
}

.carousel-control-prev {
  left: 20px;
}

.carousel-control-next {
  right: 20px;
}

.carousel-control-prev:hover,
.carousel-control-next:hover {
  background: var(--primary-blue-dark);
  opacity: 1;
}

.carousel-indicators [data-bs-target] {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  margin: 0 6px;
  background-color: var(--primary-blue-dark);
  /* Cambiado a azul oscuro */
  opacity: 0.5;
}

.carousel-indicators .active {
  opacity: 1;
  background-color: var(--primary-blue);
}

/* EXISTING STYLES - ACTUALIZADOS CON COLORES AZULES */
.section-padding {
  padding: 80px 0;
}

.section-title {
  font-size: 2.5rem;
  font-weight: 300;
  color: var(--primary-blue-dark);
  /* Cambiado a azul oscuro */
  margin-bottom: 3rem;
  position: relative;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 0;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary-blue), var(--primary-blue-dark));
  /* Cambiado a azul oscuro */
}

.btn-primary-custom {
  background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-dark));
  /* Cambiado a azul oscuro */
  border: none;
  padding: 12px 30px;
  border-radius: 25px;
  transition: all 0.3s ease;
  text-transform: uppercase;
  font-weight: 500;
  letter-spacing: 1px;
  color: var(--white) !important;
  text-decoration: none;
  display: inline-block;
}

.btn-primary-custom:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(45, 129, 241, 0.3);
  color: var(--white) !important;
}

.card-custom {
  border: none;
  border-radius: 15px;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  height: 100%;
}

.card-custom:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.video-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border-radius: 15px;
}

.rounded-img {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 15px;
}

.bg-light-custom {
  background-color: var(--light-gray);
}

/* MOBILE BANNER STYLES */
.mobile-banner {
  height: 350px;
  position: relative;
  overflow: hidden;
  margin-bottom: 30px;
}

.mobile-banner img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.mobile-banner-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  color: white;
  padding: 20px;
  text-align: center;
}

/* RESPONSIVE ADJUSTMENTS */
@media (max-width: 991px) {
  .hero-carousel .carousel-item {
    height: 400px;
  }

  .carousel-caption {
    padding: 20px;
    bottom: 60px;
  }

  .carousel-caption h3 {
    font-size: 2rem;
  }
}

@media (max-width: 767px) {
  .hero-carousel .carousel-item {
    height: 350px;
  }

  .carousel-caption {
    padding: 15px;
    bottom: 30px;
    max-width: 90%;
  }

  .carousel-caption h3 {
    font-size: 1.5rem;
  }

  .carousel-caption p {
    font-size: 0.9rem;
  }

  .navbar-brand {
    font-size: 1.5rem;
  }

  .navbar-brand img {
    height: 30px;
  }

  .section-title {
    font-size: 2rem;
  }
}

/* Page context specific */
.page-content {
  padding: 40px 0 0 0;
}

.placeholder-section {
  background-color: #f8f9fa;
  border-radius: 10px;
  padding: 30px;
  margin-bottom: 30px;
  text-align: center;
}

.placeholder-section h3 {
  color: var(--primary-blue-dark);
  margin-bottom: 20px;
}

/* DEBISA & EXPERT STYLES ADDED */
.debisa-logo {
  max-width: 250px;
  width: 100%;
  height: auto;
  margin: 0 auto 30px;
  display: block;
  border-radius: 15px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  transition: var(--transition-fast);
}

.debisa-logo:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

.material-section {
  background: white;
  border-radius: 15px;
  padding: 40px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
  margin-top: 40px;
  text-align: center;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.8s ease-out forwards;
}

/* Footer Styles (Moved from base.html) */
.footer-custom {
  background-color: var(--primary-blue-dark);
  color: var(--white);
  padding: 70px 0 30px;
  margin-top: 80px;
  font-size: 0.95rem;
  position: relative;
  overflow: hidden;
}

.footer-custom::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, var(--primary-blue), var(--secondary-accent));
}

.footer-custom h5 {
  color: var(--white);
  font-weight: 700;
  margin-bottom: 25px;
  position: relative;
  padding-bottom: 15px;
}

.footer-custom h5::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 50px;
  height: 3px;
  background-color: var(--secondary-accent);
}

.footer-links {
  list-style: none;
  padding: 0;
}

.footer-links li {
  margin-bottom: 15px;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: var(--transition-fast);
  display: inline-block;
}

.footer-links a:hover {
  color: var(--white);
  transform: translateX(5px);
  text-shadow: 0 0 10px rgba(45, 129, 241, 0.5);
}

.social-icons a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.05);
  color: var(--white);
  margin-right: 12px;
  transition: var(--transition-fast);
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.social-icons a:hover {
  background-color: var(--primary-blue);
  transform: translateY(-5px);
  box-shadow: 0 5px 15px rgba(45, 129, 241, 0.4);
}

.footer-bottom {
  margin-top: 60px;
  padding-top: 30px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  text-align: center;
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.5);
}

/* DEPARTMENTS GRID */
.dept-icon-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.card-hover-effect {
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.card-hover-effect:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1) !important;
}

.card-hover-effect:hover .dept-icon-circle {
  transform: scale(1.1);
}

/* 3D CAROUSEL STYLES */
.hero-3d-section {
  background: linear-gradient(135deg, var(--primary-blue-dark) 0%, #1a237e 100%);
  min-height: 700px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.hero-bg-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('https://www.transparenttextures.com/patterns/cubes.png');
  /* Pattern example */
  opacity: 0.1;
  z-index: 1;
}

.animate-title {
  animation: fadeInDown 1s ease-out;
  text-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.carousel-3d-container {
  width: 100%;
  max-width: 900px;
  height: 500px;
  /* Increased height */
  margin: 0 auto;
  position: relative;
  perspective: 1000px;
}

.carousel-3d-inner {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
}

.carousel-3d-item {
  position: absolute;
  width: 300px;
  height: 450px;
  left: 50%;
  top: 50%;
  /* Removed negative margins, using transform for centering */
  margin: 0;
  transform: translate(-50%, -50%) scale(0.8);
  transition: all 0.5s cubic-bezier(0.25, 0.8, 0.25, 1);
  opacity: 0;
  z-index: 0;
  pointer-events: none;
}

/* Estado ACTIVO (Centro) */
.carousel-3d-item.active {
  opacity: 1;
  z-index: 10;
  transform: translate(-50%, -50%) scale(1.1);
  pointer-events: auto;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
}

/* Estado PREV (Izquierda) */
/* -50% (center) - 100% (shift left) = -150% */
.carousel-3d-item.prev {
  opacity: 0.6;
  z-index: 5;
  transform: translate(-150%, -50%) scale(0.9) rotateY(15deg);
  filter: blur(1px) brightness(0.7);
}

/* Estado NEXT (Derecha) */
/* -50% (center) + 100% (shift right) = 50% */
.carousel-3d-item.next {
  opacity: 0.6;
  z-index: 5;
  transform: translate(50%, -50%) scale(0.9) rotateY(-15deg);
  filter: blur(1px) brightness(0.7);
}

.card-3d-content {
  width: 100%;
  height: 100%;
  position: relative;
  border-radius: 15px;
  overflow: hidden;
  background: #fff;
}

.card-3d-content img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.carousel-3d-item.active:hover img {
  transform: scale(1.05);
  /* Zoom sutil al hover en activo */
}

.card-3d-info {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 20px;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.9), transparent);
  color: white;
  text-align: center;
  transform: translateY(20px);
  transition: transform 0.3s;
}

.carousel-3d-item.active .card-3d-info {
  transform: translateY(0);
}

.carousel-3d-controls button {
  width: 50px;
  height: 50px;
  border: 2px solid rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.1);
  transition: all 0.3s;
}

.carousel-3d-controls button:hover {
  background: white;
  color: var(--primary-blue);
  transform: scale(1.1);
}

@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}