/* ==========================================
   ULTRA PINTURAS - CUSTOM STYLES
   ========================================== */

/* Custom Properties (CSS Variables) */
:root {
  --primary: #0F1F3D;
  --secondary: #1C4E80;
  --accent: #FFFFFF;
  --light-gray: #F4F6F8;
  --dark-gray: #333333;
  --yellow-accent: #FCD34D;
  --green-accent: #10B981;
  --red-accent: #EF4444;
  --blue-accent: #3B82F6;
  
  /* Spacing */
  --spacing-xs: 0.25rem;
  --spacing-sm: 0.5rem;
  --spacing-md: 1rem;
  --spacing-lg: 2rem;
  --spacing-xl: 4rem;
  
  /* Typography */
  --font-family: 'Poppins', sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  
  /* Border Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 1rem;
  --radius-xl: 1.5rem;
  --radius-full: 9999px;
  
  /* Transitions */
  --transition-fast: 150ms ease-in-out;
  --transition-normal: 300ms ease-in-out;
  --transition-slow: 500ms ease-in-out;
}

/* Dark mode variables */
.dark {
  --light-gray: #1F2937;
  --accent: #F9FAFB;
  --text-primary: #F9FAFB;
  --text-secondary: #D1D5DB;
  --bg-primary: #111827;
  --bg-secondary: #1F2937;
}

/* ==========================================
   GLOBAL STYLES
   ========================================== */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  line-height: 1.6;
  overflow-x: hidden;
}

/* Improved scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--light-gray);
}

::-webkit-scrollbar-thumb {
  background: var(--secondary);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
}

/* ==========================================
   UTILITY CLASSES
   ========================================== */

/* Container with consistent padding */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 640px) {
  .container {
    padding: 0 2rem;
  }
}

/* Text utilities */
.text-gradient {
  background: linear-gradient(135deg, var(--secondary), var(--primary));
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.text-shadow {
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Background utilities */
.bg-gradient-primary {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.bg-gradient-secondary {
  background: linear-gradient(135deg, var(--secondary), var(--blue-accent));
}

.bg-glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.dark .bg-glass {
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ==========================================
   ANIMATIONS
   ========================================== */

/* Fade in animation */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.animate-fade-in {
  animation: fadeIn 0.6s ease-out forwards;
}

/* Scale animation */
@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.animate-scale-in {
  animation: scaleIn 0.4s ease-out forwards;
}

/* Slide animations */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.animate-slide-in-left {
  animation: slideInLeft 0.6s ease-out forwards;
}

.animate-slide-in-right {
  animation: slideInRight 0.6s ease-out forwards;
}

/* Pulse animation */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.7;
  }
}

.animate-pulse {
  animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Bounce animation */
@keyframes bounce {
  0%, 20%, 53%, 80%, 100% {
    transform: translate3d(0, 0, 0);
  }
  40%, 43% {
    transform: translate3d(0, -30px, 0);
  }
  70% {
    transform: translate3d(0, -15px, 0);
  }
  90% {
    transform: translate3d(0, -4px, 0);
  }
}

.animate-bounce {
  animation: bounce 1s infinite;
}

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

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

/* ==========================================
   COMPONENT STYLES
   ========================================== */

/* Button enhancements */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full);
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-normal);
  cursor: pointer;
  border: none;
  outline: none;
}

.btn-primary {
  background: var(--secondary);
  color: var(--accent);
}

.btn-primary:hover {
  background: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.btn-secondary {
  background: transparent;
  color: var(--secondary);
  border: 2px solid var(--secondary);
}

.btn-secondary:hover {
  background: var(--secondary);
  color: var(--accent);
  transform: translateY(-2px);
}

.btn-glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: var(--accent);
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
}

/* Card enhancements */
.card {
  background: var(--accent);
  border-radius: var(--radius-xl);
  padding: var(--spacing-lg);
  box-shadow: var(--shadow-md);
  transition: all var(--transition-normal);
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.dark .card {
  background: var(--bg-secondary);
  border-color: rgba(255, 255, 255, 0.1);
}

.card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
}

.card-glass {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Form enhancements */
.form-group {
  position: relative;
  margin-bottom: var(--spacing-lg);
}

.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 2px solid #e5e7eb;
  border-radius: var(--radius-lg);
  font-size: var(--font-size-base);
  transition: all var(--transition-normal);
  background: var(--accent);
}

.form-input:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 3px rgba(28, 78, 128, 0.1);
}

.dark .form-input {
  background: var(--bg-secondary);
  border-color: #374151;
  color: var(--text-primary);
}

.form-label {
  display: block;
  font-weight: 600;
  margin-bottom: var(--spacing-sm);
  color: var(--dark-gray);
}

.dark .form-label {
  color: var(--text-primary);
}

/* Loading states */
.loading {
  position: relative;
  overflow: hidden;
}

.loading::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.4), transparent);
  animation: loading 1.5s infinite;
}

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

/* ==========================================
   LAYOUT UTILITIES
   ========================================== */

/* Flex utilities */
.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flex-col-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

/* Grid utilities */
.grid-auto-fit {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--spacing-lg);
}

.grid-auto-fill {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--spacing-lg);
}

/* ==========================================
   ACCESSIBILITY
   ========================================== */

/* Focus styles */
.focus-visible {
  outline: 2px solid var(--secondary);
  outline-offset: 2px;
}

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

/* High contrast mode */
.high-contrast {
  filter: contrast(150%) brightness(110%);
}

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================
   RESPONSIVE UTILITIES
   ========================================== */

/* Mobile first breakpoints */
@media (max-width: 639px) {
  .mobile-hidden {
    display: none;
  }
  
  .mobile-full {
    width: 100%;
  }
  
  .mobile-center {
    text-align: center;
  }
}

@media (min-width: 640px) {
  .sm-show {
    display: block;
  }
}

@media (min-width: 768px) {
  .md-show {
    display: block;
  }
}

@media (min-width: 1024px) {
  .lg-show {
    display: block;
  }
}

/* ==========================================
   PRINT STYLES
   ========================================== */

@media print {
  .no-print {
    display: none !important;
  }
  
  .print-break {
    page-break-before: always;
  }
  
  body {
    background: white;
    color: black;
    font-size: 12pt;
  }
  
  a {
    text-decoration: underline;
  }
  
  a[href^="http"]:after {
    content: " (" attr(href) ")";
  }
}

/* ==========================================
   COMPONENT SPECIFIC STYLES
   ========================================== */

/* FAQ Accordion */
.faq-item {
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.dark .faq-item {
  border-bottom-color: rgba(255, 255, 255, 0.1);
}

.faq-question {
  transition: background-color var(--transition-normal);
}

.faq-answer {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
  transition: max-height 0.3s ease-in-out, 
              opacity 0.3s ease-in-out, 
              padding-top 0.3s ease-in-out, 
              padding-bottom 0.3s ease-in-out;
  word-wrap: break-word;
  white-space: normal;
}

.faq-answer.active {
  opacity: 1;
  max-height: none !important; /* Sem limite de altura */
  height: auto !important; /* Altura automática */
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  overflow: visible !important; /* Garantir que o conteúdo não seja cortado */
  min-height: fit-content !important; /* Altura mínima baseada no conteúdo */
}

/* Gallery Grid */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--spacing-lg);
}

.gallery-item {
  transition: all var(--transition-normal);
}

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

/* Service Cards */
.service-card {
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  transition: left var(--transition-slow);
}

.service-card:hover::before {
  left: 100%;
}

/* Progress Indicators */
.progress-ring {
  transform: rotate(-90deg);
}

.progress-ring-circle {
  stroke-dasharray: 251.2;
  stroke-dashoffset: 251.2;
  transition: stroke-dashoffset 0.6s ease-in-out;
}

/* Custom Scrollbar for specific containers */
.custom-scroll {
  scrollbar-width: thin;
  scrollbar-color: var(--secondary) var(--light-gray);
}

.custom-scroll::-webkit-scrollbar {
  width: 6px;
}

.custom-scroll::-webkit-scrollbar-track {
  background: var(--light-gray);
  border-radius: var(--radius-sm);
}

.custom-scroll::-webkit-scrollbar-thumb {
  background: var(--secondary);
  border-radius: var(--radius-sm);
}

/* ==========================================
   MOBILE MENU FIXES
   ========================================== */

/* Ensure mobile menu button is always visible on mobile */
@media (max-width: 1023px) {
  #mobileMenuToggle {
    display: block !important;
  }
}

/* Ensure mobile menu items are properly styled */
#mobileMenu {
  transition: all 0.3s ease;
}

#mobileMenu.hidden {
  display: none;
}

/* Mobile menu background */
#mobileMenu {
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(10px);
}

.dark #mobileMenu {
  background: rgba(15, 31, 61, 0.98);
}

/* ==========================================
   SERVICES PANEL FIXES
   ========================================== */

/* Ensure services panel doesn't go off-screen */
#selectedServicesPanel {
  max-width: calc(100vw - 2rem);
}

/* When hidden, make sure elements are completely off-screen */
#selectedServicesPanel.translate-x-full,
#serviceToast.translate-x-full {
  transform: translateX(calc(100% + 30px)) !important;
  opacity: 0;
  pointer-events: none;
}

/* Ensure elements start hidden */
#selectedServicesPanel,
#serviceToast {
  transform: translateX(calc(100% + 30px));
  opacity: 0;
  pointer-events: none;
}

/* When visible, ensure proper positioning */
#selectedServicesPanel.translate-x-0 {
  transform: translateX(0) !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

#serviceToast.translate-x-0 {
  transform: translateX(0) !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

@media (max-width: 640px) {
  #selectedServicesPanel {
    right: 1rem !important;
    left: 1rem;
    max-width: none;
    width: auto;
    bottom: 5rem;
  }
  
  /* Extra margin for mobile to ensure it's off-screen */
  #selectedServicesPanel.translate-x-full {
    transform: translateX(calc(100% + 40px)) !important;
  }
}

/* ==========================================
   PERFORMANCE OPTIMIZATIONS
   ========================================== */

/* Use GPU acceleration for animations */
.gpu-accelerated {
  transform: translateZ(0);
  will-change: transform;
}

/* Optimize images */
img {
  max-width: 100%;
  height: auto;
}

/* Lazy loading placeholder */
.lazy-placeholder {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: loading 1.5s infinite;
}

.dark .lazy-placeholder {
  background: linear-gradient(90deg, #374151 25%, #4B5563 50%, #374151 75%);
  background-size: 200% 100%;
}

/* ==========================================
   HERO CAROUSEL STYLES
   ========================================== */

/* Carousel container */
.carousel-container {
  position: relative;
  overflow: hidden;
}

/* Carousel slides */
.carousel-slide {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  opacity: 0 !important;
  z-index: 1 !important;
  transition: opacity 1000ms ease-in-out !important;
  will-change: opacity;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.carousel-slide.active {
  opacity: 1 !important;
  z-index: 2 !important;
}

/* Carousel navigation buttons */
.carousel-nav {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  transition: all 300ms ease;
}

.carousel-nav:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: scale(1.1);
}

/* Carousel indicators */
.carousel-indicator {
  cursor: pointer;
  transition: all 300ms ease;
}

.carousel-indicator:hover {
  transform: scale(1.2);
}

.carousel-indicator.active {
  transform: scale(1.3);
}

/* Responsive adjustments for carousel */
@media (max-width: 768px) {
  .carousel-nav {
    padding: 0.5rem;
    font-size: 0.875rem;
  }
  
  .carousel-indicator {
    width: 0.625rem;
    height: 0.625rem;
  }
}
