/* Custom CSS for hero effects */

/* Smooth scroll optimization - Muito mais rápido */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px; /* Account for fixed header */
}

/* Scroll mais rápido para desktop */
@media (min-width: 769px) {
  html {
    scroll-behavior: smooth;
  }
}

/* Otimizações de performance para scroll */
* {
  scroll-behavior: smooth;
}

/* Melhorar performance de scroll em dispositivos móveis */
@media (max-width: 768px) {
  html {
    scroll-padding-top: 70px; /* Ajustar para header menor em mobile */
  }
}

/* Reduzir motion para usuários que preferem menos animação */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  
  * {
    scroll-behavior: auto;
  }
}

/* Prevent horizontal overflow on body */
body {
  overflow-x: hidden;
}

/* Prevent horizontal overflow */
.hero-section {
  overflow-x: hidden;
}

/* Ensure all decorative elements stay within bounds */
.hero-section .absolute {
  max-width: 100vw;
  max-height: 100vh;
}

/* Responsive adjustments for decorative elements */
@media (max-width: 768px) {
  .hero-section .absolute {
    max-width: 100%;
  }
  
  /* Reduce size of decorative elements on mobile */
  .hero-section .w-24, .hero-section .w-28 {
    width: 4rem;
  }
  
  .hero-section .w-20 {
    width: 3rem;
  }
  
  .hero-section .w-16 {
    width: 2.5rem;
  }
}

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

@keyframes drift {
  0% { transform: translateX(0px) translateY(0px); }
  33% { transform: translateX(30px) translateY(-30px); }
  66% { transform: translateX(-20px) translateY(20px); }
  100% { transform: translateX(0px) translateY(0px); }
}

@keyframes glow {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.8; }
}

@keyframes rotate-slow {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

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

.drift-animation {
  animation: drift 8s ease-in-out infinite;
}

.glow-animation {
  animation: glow 4s ease-in-out infinite;
}

.rotate-slow {
  animation: rotate-slow 20s linear infinite;
}

.hero-bg-pattern {
  background-image: 
    radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.08) 0%, transparent 60%),
    radial-gradient(circle at 80% 20%, rgba(14, 165, 233, 0.06) 0%, transparent 60%),
    radial-gradient(circle at 20% 80%, rgba(30, 64, 175, 0.05) 0%, transparent 60%),
    radial-gradient(circle at 80% 80%, rgba(29, 78, 216, 0.07) 0%, transparent 60%),
    radial-gradient(circle at 50% 50%, rgba(59, 130, 246, 0.03) 0%, transparent 70%);
}

/* Responsive adjustments for mobile */
@media (max-width: 768px) {
  .float-animation, .drift-animation, .glow-animation {
    animation-duration: 8s;
  }
  
  .rotate-slow {
    animation-duration: 30s;
  }
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  .float-animation, .drift-animation, .glow-animation, .rotate-slow {
    animation: none;
  }
}

/* WhatsApp Floating Button Styles */
.whatsapp-float {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 1000;
  transition: all 0.3s ease;
}

.whatsapp-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  background: #25D366;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.4);
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  border: none;
  outline: none;
  box-sizing: border-box;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
  user-select: none;
}

.whatsapp-link:hover {
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
  background: #128C7E;
}

.whatsapp-link:active {
  transform: scale(0.95);
}

.whatsapp-icon {
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  transition: all 0.3s ease;
}

.whatsapp-link:hover .whatsapp-icon {
  transform: none;
}

.whatsapp-tooltip {
  position: absolute;
  right: 70px;
  top: 50%;
  transform: translateY(-50%);
  background: #333;
  color: white;
  padding: 8px 12px;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  pointer-events: none;
}

.whatsapp-tooltip::after {
  content: '';
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-left-color: #333;
}

.whatsapp-link:hover .whatsapp-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(-5px);
}

/* Pulse animation removed - no more shadow animation */

/* Mobile responsiveness */
@media (max-width: 768px) {
  .whatsapp-float {
    bottom: 15px;
    right: 15px;
  }
  
  .whatsapp-link {
    width: 55px;
    height: 55px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    background-clip: padding-box;
    -webkit-background-clip: padding-box;
  }
  
  .whatsapp-tooltip {
    display: none; /* Hide tooltip on mobile for cleaner look */
  }
}

@media (max-width: 480px) {
  .whatsapp-float {
    bottom: 10px;
    right: 10px;
  }
  
  .whatsapp-link {
    width: 50px;
    height: 50px;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    background-clip: padding-box;
    -webkit-background-clip: padding-box;
  }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  .whatsapp-tooltip {
    background: #1f2937;
    color: #f9fafb;
  }
  
  .whatsapp-tooltip::after {
    border-left-color: #1f2937;
  }
}

/* Accessibility improvements */
.whatsapp-link:focus {
  outline: 2px solid #25D366;
  outline-offset: 2px;
  border-radius: 50%;
}

/* Ensure perfect circular shape and remove any square silhouette */
.whatsapp-link,
.whatsapp-link:before,
.whatsapp-link:after {
  border-radius: 50% !important;
  border: none !important;
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
  -webkit-tap-highlight-color: transparent !important;
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  user-select: none !important;
  background-clip: padding-box !important;
  -webkit-background-clip: padding-box !important;
}

/* Remove any potential square outline */
.whatsapp-link:focus-visible {
  outline: 2px solid #25D366;
  outline-offset: 2px;
  border-radius: 50%;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  .whatsapp-link {
    transition: none;
  }
  
  .whatsapp-link:hover .whatsapp-icon {
    transform: none;
  }
}

/* ===== MODAL DE COMPRA ===== */
/* Modal overlay and animations */
#purchaseModal {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

#purchaseModal .transform {
  animation: modalSlideIn 0.3s ease-out;
}

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

/* Modal content styling */
#purchaseModal .inline-block {
  max-height: 90vh;
  overflow-y: auto;
}

/* Progress bar styling */
#progressBar {
  background: linear-gradient(90deg, #3b82f6, #1d4ed8);
  box-shadow: 0 2px 4px rgba(59, 130, 246, 0.3);
}

/* Form inputs styling */
#purchaseModal input[type="text"],
#purchaseModal input[type="email"],
#purchaseModal input[type="tel"] {
  transition: all 0.2s ease;
}

#purchaseModal input:focus {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

/* Template selection styling */
.template-option {
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.template-option::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.1), transparent);
  transition: left 0.5s ease;
}

.template-option:hover::before {
  left: 100%;
}

.template-option:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.template-option.selected {
  border-color: #3b82f6;
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

/* Button styling */
#purchaseModal button {
  transition: all 0.2s ease;
}

#purchaseModal button:hover {
  transform: translateY(-1px);
}

#purchaseModal button:active {
  transform: translateY(0);
}

/* Step content transitions */
.step-content {
  transition: all 0.3s ease;
}

.step-content.hidden {
  opacity: 0;
  transform: translateX(20px);
  pointer-events: none;
}

.step-content:not(.hidden) {
  opacity: 1;
  transform: translateX(0);
}

/* Order summary styling */
#orderSummary {
  background: linear-gradient(135deg, #f8fafc, #f1f5f9);
  border: 1px solid #e2e8f0;
}

/* Responsive adjustments for modal */
@media (max-width: 1024px) {
  #purchaseModal .grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 768px) {
  #purchaseModal .inline-block {
    margin: 1rem;
    max-width: calc(100vw - 2rem);
  }
  
  #purchaseModal .grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .template-option {
    padding: 1rem;
  }
  
  .template-option img {
    height: 120px;
  }
}

@media (max-width: 480px) {
  #purchaseModal .p-6 {
    padding: 1rem;
  }
  
  #purchaseModal .grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .template-option {
    padding: 0.75rem;
  }
  
  .template-option img {
    height: 100px;
  }
}

/* Line clamp for description text */
.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Loading states */
.template-option.loading {
  opacity: 0.6;
  pointer-events: none;
}

.template-option.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid #3b82f6;
  border-top: 2px solid transparent;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Success states */
.template-option.selected::after {
  content: '✓';
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  background: #10b981;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: bold;
}

/* Form validation styling */
#purchaseModal input.error {
  border-color: #ef4444;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

#purchaseModal input.success {
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  #purchaseModal .transform,
  .template-option,
  #purchaseModal button,
  .step-content {
    transition: none;
  }
  
  .template-option::before {
    display: none;
  }
  
  .template-option.loading::after {
    animation: none;
  }
}

/* Focus styles for better accessibility */
#purchaseModal button:focus,
#purchaseModal input:focus,
.template-option:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .template-option {
    border-width: 3px;
  }
  
  .template-option.selected {
    border-color: #000;
    background: #fff;
  }
}

/* Template selection buttons */
.template-option .absolute {
  transition: all 0.2s ease;
}

.template-option:hover .absolute {
  transform: scale(1.1);
}

/* Eye button hover effect */
.template-option button:hover {
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

/* Selection check icon animation */
.template-option .bg-green-500 {
  animation: checkPulse 0.3s ease-out;
}

@keyframes checkPulse {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* Template error message */
#template-error {
  animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ===== TEMPLATES CAROUSEL ===== */
.templates-carousel {
  position: relative;
  overflow: hidden;
  width: 100%;
}

.templates-carousel-track {
  display: flex;
  transition: transform 0.5s ease-in-out;
  will-change: transform;
}

.template-slide {
  flex: 0 0 auto;
  width: 100%;
  max-width: 300px;
  margin-right: 0;
  position: relative;
  border-radius: 0;
  overflow: hidden;
  box-shadow: none;
  transition: all 0.3s ease;
}

.template-slide:hover {
  transform: none;
  box-shadow: none;
}

.template-slide img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  display: block;
}

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

.template-slide:hover .template-slide-overlay {
  transform: translateY(0);
}

.template-slide-title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.template-slide-category {
  font-size: 0.875rem;
  opacity: 0.8;
}

/* Carousel navigation dots - removed */

/* Auto-scroll animation */
@keyframes autoScroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-100%);
  }
}

.templates-carousel-track.auto-scroll {
  animation: autoScroll 30s linear infinite;
}

.templates-carousel-track.auto-scroll:hover {
  animation-play-state: paused;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .template-slide {
    max-width: 250px;
    margin-right: 0;
  }
  
  .template-slide img {
    height: 150px;
  }
  
  .template-slide-overlay {
    padding: 0.75rem;
  }
  
  .template-slide-title {
    font-size: 0.875rem;
  }
  
  .template-slide-category {
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .template-slide {
    max-width: 200px;
    margin-right: 0;
  }
  
  .template-slide img {
    height: 120px;
  }
  
  .template-slide-overlay {
    padding: 0.5rem;
  }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
  .templates-carousel-track {
    transition: none;
  }
  
  .templates-carousel-track.auto-scroll {
    animation: none;
  }
  
  .template-slide {
    transition: none;
  }
  
  .template-slide-overlay {
    transition: none;
  }
  
}

/* Focus styles for keyboard navigation */
.template-slide:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  .template-slide {
    border: 2px solid #000;
  }
}

/* ===== PORTFOLIO CAROUSEL ===== */
.portfolio-carousel {
  position: relative;
  overflow: hidden;
  width: 100%;
}

.portfolio-carousel-track {
  display: flex;
  transition: transform 0.5s ease-in-out;
  will-change: transform;
}

.portfolio-slide {
  flex: 0 0 auto;
  width: 100%;
  max-width: 400px;
  margin-right: 1.5rem;
  position: relative;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  cursor: pointer;
}

.portfolio-slide:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.portfolio-slide img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  display: block;
}

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

.portfolio-slide:hover .portfolio-slide-overlay {
  transform: translateY(0);
}

.portfolio-slide-title {
  font-weight: 600;
  font-size: 1.125rem;
  margin-bottom: 0.5rem;
}

.portfolio-slide-description {
  font-size: 0.875rem;
  opacity: 0.9;
  line-height: 1.4;
}

/* Portfolio navigation dots */
.portfolio-dots {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 2rem;
}

.portfolio-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #d1d5db;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  outline: none;
}

.portfolio-dot.active {
  background: #3b82f6;
  transform: scale(1.2);
}

.portfolio-dot:hover {
  background: #6b7280;
  transform: scale(1.1);
}

/* ===== LIGHTBOX ===== */
#lightbox-modal {
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

#lightbox-modal.show {
  display: flex !important;
  animation: lightboxFadeIn 0.3s ease-out;
}

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

#lightbox-image {
  animation: lightboxZoomIn 0.3s ease-out;
}

@keyframes lightboxZoomIn {
  from {
    transform: scale(0.8);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

/* Responsive adjustments for portfolio */
@media (max-width: 768px) {
  .portfolio-slide {
    max-width: 300px;
    margin-right: 1rem;
  }
  
  .portfolio-slide img {
    height: 200px;
  }
  
  .portfolio-slide-overlay {
    padding: 1rem;
  }
  
  .portfolio-slide-title {
    font-size: 1rem;
  }
  
  .portfolio-slide-description {
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  .portfolio-slide {
    max-width: 250px;
    margin-right: 0.75rem;
  }
  
  .portfolio-slide img {
    height: 180px;
  }
  
  .portfolio-slide-overlay {
    padding: 0.75rem;
  }
}

/* Accessibility improvements for portfolio */
@media (prefers-reduced-motion: reduce) {
  .portfolio-carousel-track {
    transition: none;
  }
  
  .portfolio-slide {
    transition: none;
  }
  
  .portfolio-slide-overlay {
    transition: none;
  }
  
  .portfolio-dot {
    transition: none;
  }
  
  #lightbox-modal.show {
    animation: none;
  }
  
  #lightbox-image {
    animation: none;
  }
}

/* Focus styles for portfolio */
.portfolio-slide:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

.portfolio-dot:focus {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

/* High contrast mode support for portfolio */
@media (prefers-contrast: high) {
  .portfolio-slide {
    border: 2px solid #000;
  }
  
  .portfolio-dot {
    border: 2px solid #000;
  }
  
  .portfolio-dot.active {
    background: #000;
  }
}
