/* ANS Assessoria Contábil - Custom Styles */

/* ========================================
   Base & Reset
   ======================================== */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 80px;
}

body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

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

::-webkit-scrollbar-thumb:hover {
  background: #b08f20;
}

/* ========================================
   Selection Color
   ======================================== */
::selection {
  background: #c9a227;
  color: #1a1a2e;
}

/* ========================================
   Focus States (Accessibility)
   ======================================== */
*:focus {
  outline: 2px solid #c9a227;
  outline-offset: 2px;
}

*:focus:not(:focus-visible) {
  outline: none;
}

*:focus-visible {
  outline: 2px solid #c9a227;
  outline-offset: 2px;
}

/* ========================================
   Header Transitions
   ======================================== */
#header {
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

#header.scrolled {
  background-color: rgba(26, 26, 46, 0.98);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

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

#mobile-menu.active {
  max-height: 400px;
  opacity: 1;
}

/* ========================================
   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);
  }
}

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

.animate-fade-in-up {
  animation: fadeInUp 0.6s ease forwards;
}

.animate-fade-in-left {
  animation: fadeInLeft 0.6s ease forwards;
}

.animate-fade-in-right {
  animation: fadeInRight 0.6s ease forwards;
}

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

/* ========================================
   Intersection Observer Animations
   ======================================== */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* Stagger children animations */
.reveal-stagger > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.reveal-stagger.active > *:nth-child(1) { transition-delay: 0.1s; }
.reveal-stagger.active > *:nth-child(2) { transition-delay: 0.2s; }
.reveal-stagger.active > *:nth-child(3) { transition-delay: 0.3s; }
.reveal-stagger.active > *:nth-child(4) { transition-delay: 0.4s; }
.reveal-stagger.active > *:nth-child(5) { transition-delay: 0.5s; }
.reveal-stagger.active > *:nth-child(6) { transition-delay: 0.6s; }

.reveal-stagger.active > * {
  opacity: 1;
  transform: translateY(0);
}

/* ========================================
   Form Styles
   ======================================== */
input,
select,
textarea {
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

input:focus,
select:focus,
textarea:focus {
  border-color: transparent;
  box-shadow: 0 0 0 3px rgba(201, 162, 39, 0.2);
}

/* Phone input mask styling */
input[type="tel"] {
  letter-spacing: 0.5px;
}

/* Select arrow customization */
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 1.5em;
  padding-right: 3rem;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* ========================================
   Button Hover Effects
   ======================================== */
.btn-hover-lift {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.btn-hover-lift:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* ========================================
   Card Hover Effects
   ======================================== */
.card-hover {
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

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

/* ========================================
   Back to Top Button
   ======================================== */
#back-to-top {
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
}

#back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

#back-to-top:hover {
  transform: scale(1.1);
}

/* ========================================
   Image Effects
   ======================================== */
.img-hover-zoom {
  overflow: hidden;
}

.img-hover-zoom img {
  transition: transform 0.5s ease;
}

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

/* ========================================
   Loading State
   ======================================== */
.loading {
  position: relative;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ========================================
   Toast Notifications
   ======================================== */
.toast {
  position: fixed;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  padding: 1rem 2rem;
  border-radius: 0.75rem;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  z-index: 9999;
  opacity: 0;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast-success {
  background: #059669;
  color: white;
}

.toast-error {
  background: #dc2626;
  color: white;
}

/* ========================================
   Gradient Text
   ======================================== */
.gradient-text {
  background: linear-gradient(135deg, #c9a227 0%, #d4af37 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ========================================
   Section Dividers
   ======================================== */
.section-divider {
  position: relative;
}

.section-divider::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background: #c9a227;
  border-radius: 2px;
}

/* ========================================
   Responsive Utilities
   ======================================== */
@media (max-width: 640px) {
  html {
    scroll-padding-top: 70px;
  }

  .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
  header,
  footer,
  #back-to-top,
  .no-print {
    display: none !important;
  }

  body {
    font-size: 12pt;
    color: #000;
  }

  a {
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
  }
}

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