/* ===== AVVOCATO360 CUSTOM STYLES ===== */
/* 
Custom styles to complement Tailwind CSS
- Custom animations and micro-interactions
- Legal industry specific styling
- Enhanced accessibility features
- Performance optimizations
*/

/* Performance optimized base styles */
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Reduce layout thrashing */
img, video, iframe {
  max-width: 100%;
  height: auto;
}

/* Optimize animations for 60fps */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* GPU acceleration for common elements */
.btn, .card, .input-field, .results-section, .error-section {
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}

/* Custom Properties for animations */
:root {
  --animation-duration: 200ms;
  --animation-easing: cubic-bezier(0.4, 0, 0.2, 1);
}

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

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

.fade-in {
  animation: fadeIn var(--animation-duration) var(--animation-easing);
}

/* Slide up animation */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.slide-up {
  animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Slide up with delay */
.slide-up-delay-1 {
  animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.1s both;
}

.slide-up-delay-2 {
  animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.2s both;
}

.slide-up-delay-3 {
  animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.3s both;
}

/* Typing effect animation */
@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes blink {
  0%, 50% {
    border-color: transparent;
  }
  51%, 100% {
    border-color: #16a34a;
  }
}

.typing-effect {
  overflow: hidden;
  border-right: 3px solid #16a34a;
  white-space: nowrap;
  animation: typing 1s steps(20, end), blink 1s step-end infinite;
}

/* Scale hover animation */
@keyframes scaleHover {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(1.02);
  }
}

.hover-scale:hover {
  animation: scaleHover 0.2s ease-out forwards;
}

/* Glow effect */
@keyframes glow {
  0%, 100% {
    box-shadow: 0 0 20px rgba(34, 197, 94, 0.3);
  }
  50% {
    box-shadow: 0 0 30px rgba(34, 197, 94, 0.5);
  }
}

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

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

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

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

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

/* Spin animation for loading spinner */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.animate-spin {
  animation: spin 1s linear infinite;
}

/* ===== CUSTOM COMPONENTS ===== */

/* Loading spinner */
.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #f3f4f6;
  border-top: 4px solid #16a34a;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

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

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

::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Dark mode scrollbar */
.dark ::-webkit-scrollbar-track {
  background: #1e293b;
}

.dark ::-webkit-scrollbar-thumb {
  background: #475569;
}

.dark ::-webkit-scrollbar-thumb:hover {
  background: #64748b;
}

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

/* Focus styles */
.focus-visible:focus-visible {
  outline: 2px solid #16a34a;
  outline-offset: 2px;
}

/* Reduced motion support */
@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 support */
@media (prefers-contrast: high) {
  .bg-green-600 {
    background-color: #000000 !important;
  }
  
  .text-green-600 {
    color: #000000 !important;
  }
  
  .border-green-500 {
    border-color: #000000 !important;
  }
}

/* ===== PRINT STYLES ===== */
@media print {
  .no-print {
    display: none !important;
  }
  
  body {
    background: white !important;
    color: black !important;
  }
  
  .bg-green-600 {
    background: #000000 !important;
    color: white !important;
  }
}

/* ===== CUSTOM UTILITIES ===== */

/* Glass morphism effect */
.glass {
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

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

/* Performance optimized transitions - only for specific properties */
* {
  transition: background-color var(--animation-duration) var(--animation-easing),
              border-color var(--animation-duration) var(--animation-easing),
              color var(--animation-duration) var(--animation-easing);
}

/* Disable transitions during page load for better performance */
.preload * {
  transition: none !important;
}

/* Ensure animations still work during preload */
.preload .slide-up,
.preload .slide-up-delay-1,
.preload .slide-up-delay-2,
.preload .slide-up-delay-3 {
  animation: none !important;
  opacity: 0 !important;
}

/* Optimize for 60fps animations */
@media (prefers-reduced-motion: no-preference) {
  .smooth-animation {
    animation-duration: 0.3s;
    animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
    animation-fill-mode: both;
  }
}

/* Reduce complexity on mobile devices */
@media (max-width: 768px) {
  .hover-glow:hover,
  .hover-bounce:hover,
  .card-hover:hover {
    transform: none;
    animation: none;
  }
  
  .gradient-text {
    animation-duration: 8s; /* Slower on mobile */
  }
}

/* Hardware accelerated button hover effects */
.btn-hover-lift {
  will-change: transform, box-shadow;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}

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

.dark .btn-hover-lift:hover {
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.3);
}

/* Optimized glow effects */
.hover-glow {
  will-change: transform, box-shadow;
  transition: transform 0.15s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translate3d(0, 0, 0);
}

.hover-glow:hover {
  box-shadow: 0 0 20px rgba(34, 197, 94, 0.4);
  transform: translate3d(0, -1px, 0);
}

/* Optimized bounce animation */
.hover-bounce {
  will-change: transform;
  transform: translate3d(0, 0, 0);
}

.hover-bounce:hover {
  animation: bounceOptimized 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* Hardware accelerated bounce animation */
@keyframes bounceOptimized {
  0%, 100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -8px, 0);
  }
}

/* Legacy bounce for fallback */
@keyframes bounce {
  0%, 20%, 60%, 100% {
    transform: translate3d(0, 0, 0);
  }
  40% {
    transform: translate3d(0, -10px, 0);
  }
  80% {
    transform: translate3d(0, -5px, 0);
  }
}

/* Optimized input focus animations */
.input-focus {
  will-change: transform, box-shadow;
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}

.input-focus:focus {
  transform: translate3d(0, 0, 0) scale(1.02);
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.1), 0 10px 25px rgba(0, 0, 0, 0.1);
}

/* Optimized card hover animations */
.card-hover {
  will-change: transform, box-shadow;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translate3d(0, 0, 0);
  backface-visibility: hidden;
}

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

.dark .card-hover:hover {
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Simplified and reliable gradient text */
@keyframes colorShift {
  0%, 100% {
    color: #16a34a;
    text-shadow: 0 0 20px rgba(22, 163, 74, 0.3);
  }
  25% {
    color: #22c55e;
    text-shadow: 0 0 20px rgba(34, 197, 94, 0.4);
  }
  50% {
    color: #10b981;
    text-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
  }
  75% {
    color: #059669;
    text-shadow: 0 0 20px rgba(5, 150, 105, 0.3);
  }
}

.gradient-text {
  color: #16a34a;
  text-shadow: 0 0 20px rgba(34, 197, 94, 0.3);
  font-weight: 700;
  display: inline-block;
  position: relative;
  animation: colorShift 3s ease-in-out infinite;
}

/* Reduce animation on low-end devices */
@media (prefers-reduced-motion: reduce) {
  .gradient-text {
    animation: none;
    color: #16a34a;
    text-shadow: none;
  }
}

/* ===== MISSING ANIMATION CLASSES ===== */

/* Slide Up Animations */
@keyframes slideUp {
  from {
    opacity: 0;
    transform: translate3d(0, 30px, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.slide-up {
  opacity: 0;
  transform: translate3d(0, 30px, 0);
  will-change: transform, opacity;
}

.slide-up.animate {
  animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.slide-up-delay-1 {
  opacity: 0;
  transform: translate3d(0, 30px, 0);
  will-change: transform, opacity;
}

.slide-up-delay-1.animate {
  animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.1s forwards;
}

.slide-up-delay-2 {
  opacity: 0;
  transform: translate3d(0, 30px, 0);
  will-change: transform, opacity;
}

.slide-up-delay-2.animate {
  animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.2s forwards;
}

.slide-up-delay-3 {
  opacity: 0;
  transform: translate3d(0, 30px, 0);
  will-change: transform, opacity;
}

.slide-up-delay-3.animate {
  animation: slideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.3s forwards;
}

/* Float Animation */
@keyframes float {
  0%, 100% {
    transform: translate3d(0, 0, 0);
  }
  50% {
    transform: translate3d(0, -10px, 0);
  }
}

.float-animation {
  animation: float 3s ease-in-out infinite;
  will-change: transform;
}

/* Hover Scale Effect */
.hover-scale {
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.hover-scale:hover {
  transform: scale(1.05) translate3d(0, 0, 0);
}

/* Glow Effect */
.glow-effect {
  position: relative;
  overflow: hidden;
}

.glow-effect::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
  transition: left 0.5s;
}

.glow-effect:hover::before {
  left: 100%;
}

/* Input Focus Animation Enhancement */
.input-focus {
  position: relative;
}

.input-focus::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #16a34a, #22c55e);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateX(-50%);
}

.input-focus:focus::after {
  width: 100%;
}

/* Enhanced Card Hover */
.card-hover {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform, box-shadow;
}

.card-hover:hover {
  transform: translate3d(0, -5px, 0);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Pulse Effect for Loading States */
@keyframes pulse {
  0%, 100% {
    opacity: 1;
  }
  50% {
    opacity: 0.5;
  }
}

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

/* Accessibility: Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  .slide-up,
  .slide-up-delay-1,
  .slide-up-delay-2,
  .slide-up-delay-3 {
    animation: none;
    opacity: 1;
    transform: none;
  }
  
  .float-animation {
    animation: none;
  }
  
  .hover-scale:hover {
    transform: none;
  }
  
  .glow-effect::before {
    transition: none;
  }
  
  .pulse-effect {
    animation: none;
  }
  
  .card-hover {
    transition: none;
  }
  
  .card-hover:hover {
    transform: none;
  }
}

/* Text selection styling */
::selection {
  background-color: #16a34a;
  color: white;
}

.dark ::selection {
  background-color: #22c55e;
  color: black;
}

/* ===== FOOTER STYLES ===== */
.footer-copyright {
  border-top: 1px solid var(--navy-700);
  padding: 1rem 0;
  margin-top: auto;
  background: var(--navy-900);
}

.dark .footer-copyright {
  border-top-color: var(--navy-700);
  background: var(--navy-900);
}

.footer-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
  text-align: center;
  display: flex;
  justify-content: center;
  align-items: center;
}

.footer-content p {
  margin: 0;
  font-size: 0.875rem;
  color: #ffffff;
  font-weight: 400;
}

.dark .footer-content p {
  color: #ffffff;
}

/* ===== LOGO STYLES ===== */
.logo-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1rem;
  height: 1rem;
  background-color: #047857;
  border-radius: 0.025rem;
  padding: 0.025rem;
  transition: all 0.2s ease-in-out;
}

.logo-container:hover {
  background-color: #065f46;
  transform: scale(1.05);
}

.app-logo {
  width: 100%;
  height: 100%;
  filter: brightness(0) invert(1);
  transition: filter 0.2s ease-in-out;
}

.dark .logo-container {
  background-color: #059669;
}

.dark .logo-container:hover {
  background-color: #047857;
}