:root {
  --color-bg-start: #1e1466;
  --color-bg-end: #5a4ff3;

  --color-text-primary: #ffffff;
  --color-text-secondary: #e5e5e5;

  --color-btn-bg: #0d0d0d;
  --color-btn-hover: #111111;
  --color-btn-text: #ffffff;
  --color-btn-icon: #25d366;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Poppins", sans-serif;
  color: var(--color-text-primary);
}

.hero-button {
  width: 60%;
  max-width: 450px;
  min-width: 280px;
  padding: 18px 24px;
  font-size: 19px;
  position: relative;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 1.5, 0.5, 1);
  background-color: var(--color-btn-bg);
  color: var(--color-btn-text);
}

.hero-button:hover {
  background-color: #f0f8ff !important;
  color: #1a1a1a !important;
  transform: scale(1.08);
}

.hero-button:hover svg {
  color: #25d366 !important;
}

@media (max-width: 640px) {
  .hero-button {
    width: 90%;
    min-width: 220px;
    font-size: 18px;
    padding: 16px 18px;
  }

  .hero-section .hero-image {
    position: relative !important;
    bottom: auto !important;
    right: auto !important;
    margin-top: 2rem;
    margin-left: auto;
    margin-right: 0;
    width: fit-content;
  }

  .hero-section .hero-image img {
    height: 40vh !important;
    width: auto !important;
  }
}

@media (max-width: 768px) and (min-width: 641px) {
  .hero-button {
    width: 90%;
    min-width: 220px;
    font-size: 18px;
    padding: 16px 18px;
  }

  .hero-section .hero-image {
    position: absolute !important;
    bottom: 0 !important;
    right: 0 !important;
    overflow: hidden;
  }

  .hero-section .hero-image img {
    height: 40vh !important;
    width: auto !important;
  }
}

@media (max-width: 1090px) and (min-width: 769px) {
  .hero-section .hero-image {
    position: absolute !important;
    bottom: 0 !important;
    right: 0 !important;
    overflow: hidden;
  }

  .hero-section .hero-image img {
    height: 50vh !important;
    width: auto !important;
  }
}

/* Hero image positioning for all screen sizes */
.hero-section .hero-image {
  position: absolute !important;
  bottom: 0 !important;
  right: 0 !important;
  overflow: hidden;
  margin: 0 !important;
  padding: 0 !important;
}

.hero-image img {
  display: block;
  object-fit: cover;
  object-position: bottom right;
  margin: 0 !important;
  padding: 0 !important;
}

/* Ensure image sticks to borders on all devices */
@media (min-width: 1091px) {
  .hero-section .hero-image {
    position: absolute !important;
    bottom: 0 !important;
    right: 0 !important;
    overflow: hidden;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
  }
  
  .hero-section .hero-image img {
    height: 80vh !important;
    width: auto !important;
    min-width: 400px;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
  }
}

/* Large screens (2K and above) */
@media (min-width: 1440px) {
  .hero-section .hero-image {
    position: absolute !important;
    bottom: 0 !important;
    right: 0 !important;
    overflow: hidden;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
  }
  
  .hero-section .hero-image img {
    height: 85vh !important;
    width: auto !important;
    min-width: 500px;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
  }
}

/* Ultra-wide and 4K screens */
@media (min-width: 1920px) {
  .hero-section .hero-image {
    position: absolute !important;
    bottom: 0 !important;
    right: 0 !important;
    overflow: hidden;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
  }
  
  .hero-section .hero-image img {
    height: 90vh !important;
    width: auto !important;
    min-width: 600px;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
  }
}

/* Extra large screens (2560px and above) */
@media (min-width: 2560px) {
  .hero-section .hero-image {
    position: absolute !important;
    bottom: 0 !important;
    right: 0 !important;
    overflow: hidden;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
    inset-inline-end: 0 !important;
    inset-block-end: 0 !important;
  }
  
  .hero-section .hero-image img {
    height: 92vh !important;
    width: auto !important;
    min-width: 700px;
    margin: 0 !important;
    padding: 0 !important;
    transform: none !important;
  }
}

.bio-carousel {
  position: relative;
  overflow: hidden;
}

/* Additional fallback rules for hero image positioning */
.hero-section {
  position: relative;
}

.hero-section .hero-image-desktop {
  position: absolute !important;
  bottom: 0 !important;
  right: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
  z-index: 1;
}

.hero-section .hero-image-desktop img {
  display: block !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
}

@keyframes scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

/* Bio Gallery Styles */
.bio-gallery {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 650px;
  margin: 0 auto;
}

/* Layout unificado para Mobile e Desktop */
.gallery-main {
  order: 1;
}

.gallery-grid {
  order: 2;
  display: flex;
  gap: 0.75rem;
  justify-content: center;
  flex-wrap: wrap;
  padding: 1rem 0;
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .gallery-grid {
    overflow-x: auto;
    justify-content: flex-start;
    flex-wrap: nowrap;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  
  .gallery-grid::-webkit-scrollbar {
    display: none;
  }
  
  .gallery-item {
    flex: 0 0 auto;
    width: 70px;
    height: 70px;
  }
}

/* Tablet and Desktop */
@media (min-width: 641px) {
  .gallery-item {
    width: 100px;
    height: 100px;
  }
}

/* Large Desktop */
@media (min-width: 1024px) {
  .gallery-item {
    width: 120px;
    height: 120px;
  }
}

.gallery-item {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 3px solid transparent;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease, filter 0.4s ease;
}

.gallery-item:hover img {
  transform: scale(1.1);
}

.gallery-item.active {
  border-color: #5a4ff3;
  box-shadow: 0 0 0 2px rgba(90, 79, 243, 0.3);
}

.gallery-item.active img {
  filter: brightness(1.1);
}

.gallery-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
  color: white;
  padding: 0.5rem;
  transform: translateY(100%);
  transition: transform 0.3s ease;
}

.gallery-item:hover .gallery-overlay {
  transform: translateY(0);
}

.gallery-caption {
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  display: block;
}

.gallery-main {
  position: relative;
}

.gallery-main img {
  width: 100%;
  height: 500px;
  object-fit: cover;
  border-radius: 16px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Responsive image heights */
@media (min-width: 1024px) {
  .gallery-main img {
    height: 600px;
  }
}

@media (max-width: 640px) {
  .gallery-main img {
    height: 350px;
  }
}

.gallery-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
}

.dot.active {
  background: #5a4ff3;
  transform: scale(1.2);
}

.dot:hover {
  background: rgba(90, 79, 243, 0.6);
  transform: scale(1.1);
}

/* Gallery Animation Effects */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.gallery-main img.changing {
  animation: fadeIn 0.6s ease-out;
}

/* Hover effects for gallery items */
.gallery-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* Gallery caption responsive */
@media (max-width: 640px) {
  .gallery-caption {
    font-size: 0.7rem;
  }
}

/* FAQ styles */
.faq-icon {
  transition: transform 0.3s ease;
}

.faq-content {
  transition: all 0.3s ease;
}

/* Contact form styles */
.notification {
  transform: translateX(100%);
  opacity: 0;
}

/* Form input focus styles */
input:focus, select:focus, textarea:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Custom select styling */
select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
  background-position: right 0.5rem center;
  background-repeat: no-repeat;
  background-size: 1.5em 1.5em;
  padding-right: 2.5rem;
  appearance: none;
}

/* Hover effects for form elements */
input:hover, select:hover, textarea:hover {
  border-color: #9ca3af;
}

/* Button hover animation */
button[type="submit"]:hover {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* Mobile adjustments */
@media (max-width: 640px) {
  .notification {
    top: 1rem;
    right: 1rem;
    left: 1rem;
    max-width: none;
  }
}

/* Gallery hover and interaction effects */
.gallery-item {
  animation: galleryItemEntrance 0.6s ease-out forwards;
}

.gallery-item:nth-child(1) { animation-delay: 0.1s; }
.gallery-item:nth-child(2) { animation-delay: 0.2s; }
.gallery-item:nth-child(3) { animation-delay: 0.3s; }
.gallery-item:nth-child(4) { animation-delay: 0.4s; }

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

/* Main image entrance animation */
.gallery-main img {
  animation: mainImageEntrance 0.8s ease-out;
}

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

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

footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--color-bg-end), transparent);
}

/* Footer animations */
.footer-bg-element {
  animation: footerFloat 6s ease-in-out infinite;
}

.footer-bg-element:nth-child(2) {
  animation-delay: -2s;
}

.footer-bg-element:nth-child(3) {
  animation-delay: -4s;
}

.footer-bg-element:nth-child(4) {
  animation-delay: -1s;
}

@keyframes footerFloat {
  0%, 100% {
    transform: translateY(0px) rotate(0deg);
    opacity: 0.05;
  }
  50% {
    transform: translateY(-10px) rotate(5deg);
    opacity: 0.1;
  }
}

/* Social media hover effects */
footer a[target="_blank"]:hover {
  transform: scale(1.1) translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* Navigation links hover effect */
footer ul li a:hover i {
  color: #ffffff !important;
}

/* Responsive footer adjustments */
@media (max-width: 768px) {
  footer .grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  footer .lg\:col-span-2 {
    grid-column: span 1;
  }
}

/* Back to Top Button */
#backToTop {
  backdrop-filter: blur(10px);
  transform: translateY(0);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

#backToTop.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

#backToTop:hover {
  background: linear-gradient(45deg, #3b82f6, #8b5cf6, #ec4899) !important;
  background-size: 200% 200%;
  animation: gradientShift 2s ease infinite;
  box-shadow: 0 20px 40px rgba(139, 92, 246, 0.3);
  transform: scale(1.1);
}

#backToTop:active {
  transform: scale(0.95);
}

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

/* Mobile adjustments for back to top button */
@media (max-width: 768px) {
  #backToTop {
    bottom: 1rem;
    right: 1rem;
    width: 3rem;
    height: 3rem;
  }
  
  #backToTop i {
    font-size: 1rem;
  }
}

/* Enhanced hover effects */
.hero-button {
  transform-origin: center;
  will-change: transform, background-color;
}

/* Service cards enhanced animations */
.service-card {
  transform-origin: center;
  will-change: transform, box-shadow;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Smooth scroll behavior enhancement */
html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
