/* Base Variables */
:root {
  /* Triadic Color Scheme */
  --primary-color: #0047ab; /* Blue */
  --primary-light: #3a6cbd;
  --primary-dark: #003a8c;
  
  --secondary-color: #ab0047; /* Red */
  --secondary-light: #bd3a6c;
  --secondary-dark: #8c003a;
  
  --tertiary-color: #47ab00; /* Green */
  --tertiary-light: #6cbd3a;
  --tertiary-dark: #3a8c00;
  
  /* Neutral Colors */
  --white: #ffffff;
  --light-gray: #f5f7fa;
  --medium-gray: #e0e5ec;
  --dark-gray: #333333;
  --black: #111111;
  
  /* Glassmorphism */
  --glass-bg: rgba(255, 255, 255, 0.15);
  --glass-border: rgba(255, 255, 255, 0.18);
  --glass-shadow: rgba(0, 0, 0, 0.1);
  
  /* Typography */
  --heading-font: 'Playfair Display', serif;
  --body-font: 'Source Sans Pro', sans-serif;
  
  /* Spacing */
  --spacing-xs: 0.5rem;
  --spacing-sm: 1rem;
  --spacing-md: 2rem;
  --spacing-lg: 4rem;
  --spacing-xl: 8rem;
  
  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 1rem;
  --radius-full: 9999px;
}

/* Base Styles */
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--body-font);
  color: var(--dark-gray);
  line-height: 1.6;
  overflow-x: hidden;
  background-color: var(--light-gray);
}

body.dark-mode {
  --light-gray: #1a1a1a;
  --medium-gray: #333333;
  --dark-gray: #f5f5f5;
  --black: #f0f0f0;
  --glass-bg: rgba(0, 0, 0, 0.25);
  --glass-border: rgba(255, 255, 255, 0.08);
  background-color: #121212;
  color: var(--white);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--heading-font);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--spacing-md);
}

p {
  margin-bottom: var(--spacing-md);
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--primary-light);
}

img {
  max-width: 100%;
  height: auto;
}

/* Container */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--spacing-md);
}

/* Glassmorphism Effects */
.glassmorphism {
  background: var(--glass-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  box-shadow: 0 8px 32px 0 var(--glass-shadow);
  border-radius: var(--radius-md);
}

/* Hyperrealistic Textures */
.texture-paper {
  background-image: url('image/paper-texture.jpg');
  background-blend-mode: overlay;
  background-size: cover;
}

.texture-concrete {
  background-image: url('image/concrete-texture.jpg');
  background-blend-mode: overlay;
  background-size: cover;
}

.texture-fabric {
  background-image: url('image/fabric-texture.jpg');
  background-blend-mode: overlay;
  background-size: cover;
}

/* Header and Navigation */
header {
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

header.scrolled {
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

/* Buttons */
.btn,
button:not(.gallery-prev):not(.gallery-next):not(.video-play-button),
input[type='submit'] {
  display: inline-block;
  padding: 0.75rem 1.5rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  outline: none;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn::before,
button:not(.gallery-prev):not(.gallery-next):not(.video-play-button)::before,
input[type='submit']::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.1);
  z-index: -1;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.btn:hover::before,
button:not(.gallery-prev):not(.gallery-next):not(.video-play-button):hover::before,
input[type='submit']:hover::before {
  transform: translateY(0);
}

.btn:active,
button:not(.gallery-prev):not(.gallery-next):not(.video-play-button):active,
input[type='submit']:active {
  transform: translateY(2px);
}

/* Primary Button */
.btn-primary {
  background-color: var(--primary-color);
  color: var(--white);
}

.btn-primary:hover {
  background-color: var(--primary-dark);
  color: var(--white);
}

/* Secondary Button */
.btn-secondary {
  background-color: var(--secondary-color);
  color: var(--white);
}

.btn-secondary:hover {
  background-color: var(--secondary-dark);
  color: var(--white);
}

/* Tertiary Button */
.btn-tertiary {
  background-color: var(--tertiary-color);
  color: var(--white);
}

.btn-tertiary:hover {
  background-color: var(--tertiary-dark);
  color: var(--white);
}

/* Outline Button */
.btn-outline {
  background-color: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
}

.btn-outline:hover {
  background-color: var(--primary-color);
  color: var(--white);
}

/* Hero Section */
#hero {
  position: relative;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  color: var(--white);
}

#hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(to right, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.3));
  z-index: 1;
}

#hero .container {
  position: relative;
  z-index: 2;
}

#hero h1 {
  font-size: 3.5rem;
  margin-bottom: var(--spacing-md);
  animation: fadeInUp 1s ease;
}

#hero p {
  font-size: 1.25rem;
  margin-bottom: var(--spacing-lg);
  animation: fadeInUp 1s ease 0.2s forwards;
  opacity: 0;
}

#hero .btn {
  animation: fadeInUp 1s ease 0.4s forwards;
  opacity: 0;
}

/* Card Styles */
.card {
  background-color: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}

.card-image {
  width: 100%;
  height: 240px;
  overflow: hidden;
}

.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.card:hover .card-image img {
  transform: scale(1.05);
}

.card-content {
  padding: var(--spacing-md);
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

/* Feature Section */
#beneficios .card {
  height: 100%;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--medium-gray);
  transition: .4s;
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: var(--white);
  transition: .4s;
}

input:checked + .slider {
  background-color: var(--primary-color);
}

input:checked + .slider:before {
  transform: translateX(26px);
}

.slider.round {
  border-radius: 34px;
}

.slider.round:before {
  border-radius: 50%;
}

/* Gallery */
.image-gallery {
  width: 100%;
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}

.gallery-container {
  position: relative;
  width: 100%;
  height: 500px;
  overflow: hidden;
}

.gallery-item {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 0.6s ease;
}

.gallery-item.active {
  opacity: 1;
  z-index: 1;
}

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

.gallery-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: var(--spacing-md);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
  color: var(--white);
}

.gallery-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--spacing-sm);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(5px);
  position: relative;
  z-index: 2;
}

.gallery-prev,
.gallery-next {
  background: transparent;
  border: none;
  color: var(--primary-color);
  font-size: 1.5rem;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.3s ease;
}

.gallery-prev:hover,
.gallery-next:hover {
  background: rgba(0, 0, 0, 0.1);
}

.gallery-dots {
  display: flex;
  justify-content: center;
  align-items: center;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--medium-gray);
  margin: 0 5px;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease;
}

.dot.active {
  background: var(--primary-color);
  transform: scale(1.2);
}

/* Testimonials */
#historias .bg-gradient-to-br {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

#historias .bg-gradient-to-br:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

/* Team Section */
#equipo .card {
  text-align: center;
}

#equipo .card-image {
  height: 250px;
  border-radius: 0;
  overflow: hidden;
}

/* Video Play Button */
.video-play-button {
  transition: transform 0.3s ease, background 0.3s ease;
}

.video-play-button:hover {
  transform: scale(1.1) !important;
}

/* Contact Form */
form .w-full {
  transition: border 0.3s ease, box-shadow 0.3s ease;
}

form .w-full:focus {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(0, 71, 171, 0.2);
}

/* Read More Links */
.text-blue-600,
a[class*="text-blue"] {
  position: relative;
  display: inline-block;
  font-weight: 600;
  transition: color 0.3s ease;
}

.text-blue-600::after,
a[class*="text-blue"]::after {
  content: '';
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -2px;
  left: 0;
  background-color: currentColor;
  transition: width 0.3s ease;
}

.text-blue-600:hover::after,
a[class*="text-blue"]:hover::after {
  width: 100%;
}

/* Footer */
footer {
  position: relative;
}

footer a {
  transition: color 0.3s ease;
}

footer .social-links a {
  display: inline-block;
  margin-right: var(--spacing-sm);
  font-weight: 600;
  transition: transform 0.3s ease, color 0.3s ease;
}

footer .social-links a:hover {
  transform: translateY(-3px);
}

/* Cookie Consent */
#cookie-consent {
  transition: transform 0.5s ease, opacity 0.5s ease;
}

#cookie-consent.hidden {
  transform: translateY(100%);
  opacity: 0;
}

/* Success Page */
.success-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: var(--spacing-lg);
}

.success-icon {
  font-size: 5rem;
  color: var(--tertiary-color);
  margin-bottom: var(--spacing-md);
}

/* Privacy & Terms Pages */
.privacy-page,
.terms-page {
  padding-top: 100px;
  padding-bottom: var(--spacing-xl);
}

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

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

@keyframes float {
  0% {
    transform: translateY(0px);
  }
  50% {
    transform: translateY(-10px);
  }
  100% {
    transform: translateY(0px);
  }
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1);
  }
}

/* Utility Classes */
.text-center {
  text-align: center;
}

.rounded {
  border-radius: var(--radius-md);
}

.shadow {
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.animate-float {
  animation: float 6s ease-in-out infinite;
}

.animate-pulse {
  animation: pulse 3s ease-in-out infinite;
}

/* Media Queries */
@media (max-width: 768px) {
  #hero h1 {
    font-size: 2.5rem;
  }
  
  #hero p {
    font-size: 1rem;
  }
  
  .gallery-container {
    height: 300px;
  }
  
  .card-image {
    height: 200px;
  }
}

@media (max-width: 480px) {
  #hero h1 {
    font-size: 2rem;
  }
  
  .gallery-container {
    height: 250px;
  }
  
  .card-image {
    height: 180px;
  }
}

/* Specific class for drawing-like animations */
.drawing-animation {
  position: relative;
  overflow: hidden;
}

.drawing-animation::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('image/drawing-animation-overlay.jpg');
  background-size: cover;
  opacity: 0.1;
  animation: drawing 3s linear infinite;
}

@keyframes drawing {
  0% {
    background-position: 0% 0%;
  }
  100% {
    background-position: 100% 100%;
  }
}

/* Additional Section Styles */
#alianzas img,
#recursos-externos img {
  transition: transform 0.3s ease;
}

#alianzas .card:hover img,
#recursos-externos a:hover img {
  transform: scale(1.05);
}

#proceso .flex-shrink-0 {
  transition: transform 0.3s ease, background-color 0.3s ease;
}

#proceso .flex:hover .flex-shrink-0 {
  transform: scale(1.1);
  background-color: var(--primary-light);
}

#reconocimientos .w-24 {
  transition: transform 0.3s ease;
}

#reconocimientos .bg-white:hover .w-24 {
  transform: rotate(10deg);
}

/* News Section */
#noticias .card {
  height: 100%;
}

#noticias .card-image {
  height: 200px;
}

/* Dark Mode Transitions */
.dark-mode .card {
  background-color: #2a2a2a;
  border: 1px solid #444;
}

.dark-mode .bg-white {
  background-color: #2a2a2a !important;
}

.dark-mode .text-gray-700 {
  color: #d1d1d1 !important;
}

.dark-mode .text-gray-600 {
  color: #a0a0a0 !important;
}

.dark-mode input,
.dark-mode textarea,
.dark-mode select {
  background-color: #333;
  border-color: #555;
  color: #fff;
}

.dark-mode .bg-blue-100,
.dark-mode .bg-red-100,
.dark-mode .bg-green-100,
.dark-mode .bg-yellow-100 {
  background-color: rgba(255, 255, 255, 0.1) !important;
}

/* Read more links */
a[href^="#"].text-blue-600,
a[href^="#"].text-blue-800,
a[href^="#"].text-red-600,
a[href^="#"].text-red-800,
a[href^="#"].text-green-600,
a[href^="#"].text-green-800 {
  display: inline-flex;
  align-items: center;
  font-weight: 600;
  transition: all 0.3s ease;
}

a[href^="#"].text-blue-600:hover,
a[href^="#"].text-blue-800:hover,
a[href^="#"].text-red-600:hover,
a[href^="#"].text-red-800:hover,
a[href^="#"].text-green-600:hover,
a[href^="#"].text-green-800:hover {
  transform: translateX(5px);
}

a[href^="#"].text-blue-600::after,
a[href^="#"].text-blue-800::after,
a[href^="#"].text-red-600::after,
a[href^="#"].text-red-800::after,
a[href^="#"].text-green-600::after,
a[href^="#"].text-green-800::after {
  content: '→';
  margin-left: 5px;
  transition: transform 0.3s ease;
}

a[href^="#"].text-blue-600:hover::after,
a[href^="#"].text-blue-800:hover::after,
a[href^="#"].text-red-600:hover::after,
a[href^="#"].text-red-800:hover::after,
a[href^="#"].text-green-600:hover::after,
a[href^="#"].text-green-800:hover::after {
  transform: translateX(3px);
}