/* ================================================
   COELCHA - ESTILOS PERSONALIZADOS
   Estilos modernos que complementan Tailwind CSS
   ================================================ */

/* === VARIABLES CSS === */
:root {
  /* Colores Corporativos */
  --coelcha-blue-dark: #003B7A;
  --coelcha-blue: #0066CC;
  --coelcha-blue-light: #E8F4FF;
  --coelcha-yellow: #FDB913;
  --coelcha-yellow-light: #FFD54F;

  /* Gradientes */
  --gradient-blue: linear-gradient(135deg, #003B7A 0%, #0066CC 100%);
  --gradient-yellow: linear-gradient(135deg, #FDB913 0%, #FFD54F 100%);

  /* Sombras */
  --shadow-sm: 0 2px 4px rgba(0, 59, 122, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 59, 122, 0.1);
  --shadow-lg: 0 10px 20px rgba(0, 59, 122, 0.15);
  --shadow-xl: 0 20px 40px rgba(0, 59, 122, 0.2);
}

/* === SMOOTH SCROLLING === */
html {
  scroll-behavior: smooth;
}

/* === BODY === */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === CUSTOM SCROLLBAR === */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
  background: var(--coelcha-blue);
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--coelcha-blue-dark);
}

/* === ANIMACIONES === */
@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }

  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes pulse {

  0%,
  100% {
    opacity: 1;
  }

  50% {
    opacity: 0.7;
  }
}

.animate-fade-in {
  animation: fadeIn 0.6s ease-out;
}

.animate-slide-up {
  animation: slideUp 0.6s ease-out;
}

.animate-slide-down {
  animation: slideDown 0.6s ease-out;
}

.animate-scale-in {
  animation: scaleIn 0.5s ease-out;
}

/* Stagger animation delay for multiple items */
.stagger-1 {
  animation-delay: 0.1s;
}

.stagger-2 {
  animation-delay: 0.2s;
}

.stagger-3 {
  animation-delay: 0.3s;
}

.stagger-4 {
  animation-delay: 0.4s;
}

.stagger-5 {
  animation-delay: 0.5s;
}

.stagger-6 {
  animation-delay: 0.6s;
}

/* === GLASSMORPHISM === */
.glass {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.glass-dark {
  background: rgba(0, 59, 122, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* === GRADIENTES === */
.gradient-blue {
  background: var(--gradient-blue);
}

.gradient-yellow {
  background: var(--gradient-yellow);
}

.gradient-overlay {
  background: linear-gradient(135deg, rgba(0, 59, 122, 0.9) 0%, rgba(0, 102, 204, 0.8) 100%);
}

/* === EFECTOS DE HOVER === */
.hover-lift {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.hover-lift:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
}

.hover-scale {
  transition: transform 0.3s ease;
}

.hover-scale:hover {
  transform: scale(1.05);
}

.hover-glow {
  position: relative;
  transition: all 0.3s ease;
}

.hover-glow::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.3s ease;
  background: radial-gradient(circle at center, rgba(253, 185, 19, 0.3) 0%, transparent 70%);
}

.hover-glow:hover::before {
  opacity: 1;
}

/* === BOTONES === */
.btn-primary {
  background: var(--gradient-blue);
  color: white;
  padding: 0.75rem 2rem;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: var(--gradient-yellow);
  color: var(--coelcha-blue-dark);
  padding: 0.75rem 2rem;
  border-radius: 0.5rem;
  font-weight: 600;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-md);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

/* === TARJETAS === */
.card {
  background: white;
  border-radius: 1rem;
  padding: 2rem;
  box-shadow: var(--shadow-md);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

.card-icon {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  margin-bottom: 1rem;
  transition: all 0.3s ease;
}

.card:hover .card-icon {
  transform: scale(1.1) rotate(5deg);
}

/* Mobile optimizations for service cards - Title Top, Description+Button Bottom */
@media (max-width: 768px) {
  .card {
    padding: 0.875rem;
    display: block;
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    max-width: 100%;
    overflow: hidden;
  }

  /* Hide decorative icon on mobile */
  .card-icon {
    display: none;
  }

  /* Remove default div wrapper constraints */
  .card>div {
    display: contents;
  }

  /* Title styling - full width on top */
  .card h3 {
    font-size: 0.9375rem;
    line-height: 1.3;
    margin-bottom: 0.5rem;
    font-weight: 700;
    color: #1f2937;
    word-wrap: break-word;
    overflow-wrap: break-word;
    display: block;
    width: 100%;
  }

  /* Description and button container */
  .card p {
    font-size: 0.8125rem;
    line-height: 1.4;
    margin-bottom: 0;
    color: #6b7280;
    font-weight: 400;
    word-wrap: break-word;
    overflow-wrap: break-word;
    display: inline-block;
    width: calc(100% - 50px);
    vertical-align: top;
  }

  /* Action button - circular icon, aligned right */
  .card a {
    font-size: 0;
    padding: 0;
    width: 40px;
    height: 40px;
    min-width: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #003B7A;
    color: white;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(0, 59, 122, 0.2);
    vertical-align: top;
    float: right;
    margin-left: 0.75rem;
  }

  .card a i {
    font-size: 1.125rem;
    margin: 0 !important;
  }

  /* Hover effect adjustments for mobile */
  .card:hover {
    transform: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
  }

  .card:active {
    transform: scale(0.98);
  }
}

/* Mobile optimizations for news cards - 3 Column Grid */
@media (max-width: 768px) {

  /* News article cards in 3-column grid */
  #noticias .card {
    padding: 0.5rem;
  }

  /* Image container */
  #noticias .card .relative {
    margin-bottom: 0.5rem;
  }

  /* News image - reduced height */
  #noticias .card img {
    height: 80px;
    object-fit: cover;
  }

  /* Badge "NOTICIA" - smaller */
  #noticias .card .absolute {
    top: 0.25rem;
    left: 0.25rem;
    padding: 0.125rem 0.375rem;
    font-size: 0.5rem;
  }

  /* Date container */
  #noticias .card .flex.items-center {
    font-size: 0.6rem;
    margin-bottom: 0.25rem;
  }

  #noticias .card .flex.items-center i {
    font-size: 0.6rem;
    margin-right: 0.25rem;
  }

  /* Title */
  #noticias .card h3 {
    font-size: 0.75rem;
    line-height: 1.2;
    margin-bottom: 0.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* Description */
  #noticias .card p {
    font-size: 0.65rem;
    line-height: 1.3;
    margin-bottom: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* Button "Ver más" */
  #noticias .card a.btn-primary {
    padding: 0.375rem 0.5rem;
    font-size: 0.65rem;
    border-radius: 0.375rem;
  }

  #noticias .card a.btn-primary i {
    font-size: 0.65rem;
    margin-left: 0.25rem;
  }
}

/* Mobile optimizations for gallery - Single Image Carousel */
@media (max-width: 768px) {

  /* Keep carousel controls visible */
  .gallery-multi-prev,
  .gallery-multi-next {
    width: 35px;
    height: 35px;
  }

  /* Adjust button positioning for mobile */
  .gallery-multi-prev {
    left: 0.5rem !important;
  }

  .gallery-multi-next {
    right: 0.5rem !important;
  }

  .gallery-multi-prev svg,
  .gallery-multi-next svg {
    width: 18px;
    height: 18px;
  }

  /* Indicators - smaller for mobile */
  .gallery-multi-indicators {
    bottom: 0.5rem;
  }

  .gallery-multi-indicators button {
    width: 6px;
    height: 6px;
  }

  /* Carousel container */
  .gallery-multi-carousel {
    overflow: hidden;
    padding: 0;
  }

  /* Configure track for single image display */
  .gallery-multi-track {
    display: flex !important;
    gap: 1rem;
  }

  /* Each slide takes 100% width on mobile */
  .gallery-multi-slide {
    width: 100% !important;
    min-width: 100% !important;
    flex-shrink: 0;
  }

  /* Gallery images - taller for mobile single view */
  .gallery-multi-slide img {
    height: 250px;
    width: 100%;
    object-fit: cover;
  }

  /* Remove hover overlay on mobile */
  .gallery-multi-slide .absolute {
    display: none;
  }

  /* Enhanced shadow for single image */
  .gallery-multi-slide>div {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  }
}

/* === NAVBAR === */
.navbar {
  transition: all 0.3s ease;
}

.navbar.scrolled {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-md);
}

/* === HERO === */
.hero-overlay {
  background: linear-gradient(135deg, rgba(0, 59, 122, 0.95) 0%, rgba(0, 102, 204, 0.85) 100%);
}

/* === FLOATING SIDEBAR === */
.quick-access {
  position: fixed;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  /* Estado inicial: oculto */
  opacity: 0;
  transform: translateY(-50%) translateX(30px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: none;
}

.quick-access.show {
  opacity: 0.95;
  transform: translateY(-50%) translateX(0);
  pointer-events: all;
}

/* Toggle Button */
.quick-access-toggle {
  padding: 0.75rem;
  border-radius: 0.5rem 0 0 0.5rem;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  border: none;
  align-self: flex-end;
  margin-bottom: 0.5rem;
}

.quick-access-toggle:hover {
  transform: translateX(-3px);
  box-shadow: var(--shadow-lg);
}

.toggle-icon {
  transition: transform 0.3s ease;
  display: block;
}

/* Collapsed state */
.quick-access.collapsed .toggle-icon {
  transform: rotate(180deg);
}

/* Buttons Container */
.quick-access-buttons {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  max-height: 500px;
  overflow: hidden;
  transition: max-height 0.4s ease, opacity 0.4s ease;
}

.quick-access.collapsed .quick-access-buttons {
  max-height: 0;
  opacity: 0;
}

.quick-access-btn {
  padding: 0.75rem 1.25rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 0.875rem;
  color: white;
  text-align: right;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-md);
  min-width: 200px;
}

.quick-access-btn:hover {
  transform: translateX(-5px);
  box-shadow: var(--shadow-lg);
}

/* === SECTION DIVIDERS === */
.section-divider {
  position: relative;
  margin: 4rem 0;
}

.section-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 4px;
  background: var(--gradient-yellow);
  border-radius: 2px;
}

/* === LIGHTBOX === */
.lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  z-index: 9999;
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.lightbox.active {
  display: flex;
}

.lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 0.5rem;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.5);
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .quick-access {
    display: none;
  }

  .card {
    padding: 1.5rem;
  }
}

/* === UTILITIES === */
.text-gradient {
  background: var(--gradient-blue);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.border-gradient {
  border: 2px solid transparent;
  background-origin: border-box;
  background-clip: padding-box, border-box;
}

.shadow-custom {
  box-shadow: var(--shadow-md);
}

/* === GALLERY MULTI-IMAGE CAROUSEL === */
.gallery-multi-carousel {
  position: relative;
  overflow: hidden;
}

.gallery-multi-track {
  display: flex;
  gap: 1rem;
  transition: transform 0.5s ease-in-out;
}

.gallery-multi-slide {
  flex-shrink: 0;
}

.gallery-multi-prev,
.gallery-multi-next {
  cursor: pointer;
  user-select: none;
}

.gallery-multi-prev:active,
.gallery-multi-next:active {
  transform: translateY(-50%) scale(0.95);
}

.gallery-multi-indicators {
  user-select: none;
}

.gallery-multi-indicator {
  cursor: pointer;
  transition: all 0.3s ease;
}

.gallery-multi-indicator.active {
  background-color: var(--coelcha-blue);
  transform: scale(1.2);
}

.gallery-multi-indicator:hover {
  background-color: var(--coelcha-blue);
  transform: scale(1.1);
}

/* Responsive multi-carousel */
@media (max-width: 1200px) {
  .gallery-multi-slide {
    width: calc(25% - 12px) !important;
    /* 4 imágenes */
  }
}

@media (max-width: 768px) {
  .gallery-multi-slide {
    width: calc(33.333% - 10.666px) !important;
    /* 3 imágenes */
  }

  .gallery-multi-prev,
  .gallery-multi-next {
    padding: 0.5rem;
  }

  .gallery-multi-prev i,
  .gallery-multi-next i {
    font-size: 1rem;
  }

  .gallery-multi-indicator {
    width: 0.375rem;
    height: 0.375rem;
  }
}

@media (max-width: 480px) {
  .gallery-multi-slide {
    width: calc(50% - 8px) !important;
    /* 2 imágenes */
  }
}