/* =============================================
   Cimar Contabilidade - Custom Styles
   ============================================= */

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

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 10px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #116298;
  border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
  background: #0d4a73;
}

/* Selection Color */
::selection {
  background: #116298;
  color: white;
}

/* Focus Styles for Accessibility */
*:focus-visible {
  outline: 2px solid #116298;
  outline-offset: 2px;
}

/* Header Scroll Effect */
#header.scrolled {
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Mobile Menu Animation */
#mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease-out;
}

#mobile-menu.active {
  max-height: 500px;
}

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

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

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

#inicio h1 {
  animation: fadeInUp 0.8s ease-out;
}

#inicio p {
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

#inicio .flex.flex-wrap {
  animation: fadeInUp 0.8s ease-out 0.3s both;
}

#inicio .flex.flex-col {
  animation: fadeInUp 0.8s ease-out 0.4s both;
}

/* Scroll Animations */
.animate-on-scroll {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Service Cards Hover */
#servicos .group:hover {
  transform: translateY(-5px);
}

/* Stats Counter Animation */
@keyframes countUp {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

.stat-number {
  animation: countUp 0.5s ease-out;
}

/* Form Input Focus Effects */
input:focus,
textarea:focus,
select:focus {
  box-shadow: 0 0 0 3px rgba(17, 98, 152, 0.1);
}

/* Button Ripple Effect */
.btn-ripple {
  position: relative;
  overflow: hidden;
}

.btn-ripple::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s ease, height 0.6s ease;
}

.btn-ripple:active::after {
  width: 300px;
  height: 300px;
}

/* Loading Spinner */
.spinner {
  width: 24px;
  height: 24px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* WhatsApp Button Pulse */
@keyframes pulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
  }
  50% {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(37, 211, 102, 0.6);
  }
}

/* Image Lazy Load Fade */
img[loading="lazy"] {
  opacity: 0;
  transition: opacity 0.3s ease-in;
}

img[loading="lazy"].loaded,
img:not([loading="lazy"]) {
  opacity: 1;
}

/* Phone Input Mask Placeholder */
input[type="tel"]::placeholder {
  color: #9ca3af;
}

/* Select Arrow Custom */
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  background-size: 20px;
  padding-right: 40px;
}

/* Map Container Responsive */
.map-container {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
  overflow: hidden;
}

.map-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

/* Print Styles */
@media print {
  header,
  footer,
  #mobile-menu,
  .fixed {
    display: none !important;
  }

  section {
    page-break-inside: avoid;
  }
}

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

  html {
    scroll-behavior: auto;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .bg-primary {
    background-color: #0a4670 !important;
  }

  .text-gray-600 {
    color: #374151 !important;
  }
}

/* Dark Mode Support (future) */
@media (prefers-color-scheme: dark) {
  /* Reserved for future dark mode implementation */
}
