/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

/* Custom styles for dashboard navigation links */
.no-underline {
  text-decoration: none !important;
}

.no-underline:visited {
  color: inherit !important;
}

/* Ensure navigation links in order cards maintain their intended colors */
.text-blue-600.no-underline:visited {
  color: rgb(37 99 235) !important; /* blue-600 */
}

.text-purple-600.no-underline:visited {
  color: rgb(147 51 234) !important; /* purple-600 */
}

/* Animation for shake effect */
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  10%, 30%, 50%, 70%, 90% { transform: translateX(-5px); }
  20%, 40%, 60%, 80% { transform: translateX(5px); }
}

.animate-shake {
  animation: shake 0.5s ease-in-out;
}

/* Custom animation for coupon cards */
@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.animate-slide-in {
  animation: slideInRight 0.3s ease-out;
}

/* Pagy navigation styles */
.pagy.nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: center;
}

.pagy.nav a,
.pagy.nav span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  border-radius: 0.375rem;
  transition: all 0.15s ease-in-out;
  text-decoration: none;
  min-width: 2.5rem;
  height: 2.5rem;
}

.pagy.nav a {
  color: rgb(75 85 99); /* gray-600 */
  background-color: white;
  border: 1px solid rgb(209 213 219); /* gray-300 */
}

.pagy.nav a:hover {
  background-color: rgb(249 250 251); /* gray-50 */
  border-color: rgb(156 163 175); /* gray-400 */
}

.pagy.nav a.current,
.pagy.nav span.current {
  color: white;
  background-color: rgb(37 99 235); /* blue-600 */
  border: 1px solid rgb(37 99 235);
  cursor: default;
}

.pagy.nav a[aria-disabled="true"] {
  color: rgb(156 163 175); /* gray-400 */
  cursor: not-allowed;
  opacity: 0.5;
}

/* Dark mode pagination styles */
.dark .pagy.nav a {
  color: rgb(156 163 175); /* gray-400 */
  background-color: transparent;
  border-color: rgb(55 65 81); /* gray-700 */
}

.dark .pagy.nav a:hover {
  background-color: rgba(255 255 255 / 0.03);
  border-color: rgb(75 85 99); /* gray-600 */
  color: rgb(209 213 219); /* gray-300 */
}

.dark .pagy.nav a.current,
.dark .pagy.nav span.current {
  color: white;
  background-color: rgb(37 99 235); /* blue-600 */
  border-color: rgb(37 99 235);
}

.dark .pagy.nav a[aria-disabled="true"] {
  color: rgb(75 85 99); /* gray-600 */
}

/* Phone Call Row Animation */
.new-phone-call-row {
  animation: slideInFromTop 0.3s ease-out;
}

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

/* Accessibility Enhancements */

/* Enhanced focus indicators for better keyboard navigation */
*:focus-visible {
  outline: 2px solid rgb(59 130 246); /* blue-500 */
  outline-offset: 2px;
}

/* Skip to content link */
.skip-to-content:focus {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  padding: 1rem;
  background-color: rgb(37 99 235); /* blue-600 */
  color: white;
  text-decoration: none;
  border-radius: 0 0 0.5rem 0;
}

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

/* Make sr-only content visible when focused */
.sr-only:focus,
.focus\:not-sr-only:focus {
  position: static;
  width: auto;
  height: auto;
  padding: inherit;
  margin: inherit;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
  a:not(.button) {
    text-decoration: underline;
  }
  
  button, .button, [role="button"] {
    border: 2px solid currentColor;
  }
}

/* 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;
    scroll-behavior: auto !important;
  }
  
  .new-phone-call-row {
    animation: none;
  }
}

/* Ensure interactive elements have minimum touch target size */
button, 
a, 
input[type="checkbox"], 
input[type="radio"], 
select {
  min-height: 44px;
  min-width: 44px;
}

/* Smaller targets in inline contexts can be excepted */
p a,
li a,
td a,
.flex > a,
.flex > button,
.inline-flex > a,
.inline-flex > button {
  min-height: auto;
  min-width: auto;
}

/* Homepage nav uses Tailwind-specified sizes; exempt from global 44px min */
.grain-overlay nav a,
.grain-overlay nav button {
  min-height: auto;
  min-width: auto;
}

/* Focus styles for form elements */
input:focus,
textarea:focus,
select:focus {
  outline: 2px solid rgb(59 130 246); /* blue-500 */
  outline-offset: 0;
  border-color: rgb(59 130 246); /* blue-500 */
}

/* Error state for form fields */
input[aria-invalid="true"],
textarea[aria-invalid="true"],
select[aria-invalid="true"] {
  border-color: rgb(239 68 68); /* red-500 */
  background-color: rgb(254 242 242); /* red-50 */
}

input[aria-invalid="true"]:focus,
textarea[aria-invalid="true"]:focus,
select[aria-invalid="true"]:focus {
  outline-color: rgb(239 68 68); /* red-500 */
  border-color: rgb(239 68 68); /* red-500 */
}

/* Homepage: fade-in-left (unique to this file; other animations live in tailwind/application.css) */
@keyframes fade-in-left {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.animate-fade-in-left {
  animation: fade-in-left 0.8s ease-out both;
}

/* Modern Homepage Animations */
@keyframes gradient-shift {
  0%, 100% {
    transform: translateX(0%) translateY(0%);
  }
  25% {
    transform: translateX(10%) translateY(-10%);
  }
  50% {
    transform: translateX(-5%) translateY(5%);
  }
  75% {
    transform: translateX(5%) translateY(-5%);
  }
}

@keyframes gradient-shift-reverse {
  0%, 100% {
    transform: translateX(0%) translateY(0%);
  }
  25% {
    transform: translateX(-10%) translateY(10%);
  }
  50% {
    transform: translateX(5%) translateY(-5%);
  }
  75% {
    transform: translateX(-5%) translateY(5%);
  }
}

@keyframes float-3d {
  0%, 100% {
    transform: translateY(0) translateZ(0) rotateX(0) rotateY(0);
  }
  25% {
    transform: translateY(-20px) translateZ(10px) rotateX(5deg) rotateY(5deg);
  }
  50% {
    transform: translateY(10px) translateZ(-5px) rotateX(-5deg) rotateY(-5deg);
  }
  75% {
    transform: translateY(-10px) translateZ(5px) rotateX(3deg) rotateY(-3deg);
  }
}

@keyframes float-3d-reverse {
  0%, 100% {
    transform: translateY(0) translateZ(0) rotateX(0) rotateY(0);
  }
  25% {
    transform: translateY(15px) translateZ(-10px) rotateX(-5deg) rotateY(5deg);
  }
  50% {
    transform: translateY(-10px) translateZ(5px) rotateX(5deg) rotateY(-5deg);
  }
  75% {
    transform: translateY(5px) translateZ(-5px) rotateX(-3deg) rotateY(3deg);
  }
}

@keyframes float-3d-slow {
  0%, 100% {
    transform: translateY(0) translateZ(0);
  }
  50% {
    transform: translateY(-15px) translateZ(10px);
  }
}

@keyframes rotate-3d {
  from {
    transform: rotateY(0deg) rotateX(0deg);
  }
  to {
    transform: rotateY(360deg) rotateX(360deg);
  }
}

@keyframes rotate-3d-reverse {
  from {
    transform: rotateY(0deg) rotateX(0deg);
  }
  to {
    transform: rotateY(-360deg) rotateX(-360deg);
  }
}

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

@keyframes pulse-glow {
  0%, 100% {
    opacity: 0.5;
    filter: blur(20px);
  }
  50% {
    opacity: 1;
    filter: blur(30px);
  }
}

@keyframes gradient-flow {
  0%, 100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes float-gentle {
  0%, 100% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(20px, -20px);
  }
  50% {
    transform: translate(-10px, 10px);
  }
  75% {
    transform: translate(10px, -10px);
  }
}

@keyframes float-gentle-reverse {
  0%, 100% {
    transform: translate(0, 0);
  }
  25% {
    transform: translate(-20px, 20px);
  }
  50% {
    transform: translate(10px, -10px);
  }
  75% {
    transform: translate(-10px, 10px);
  }
}

@keyframes bounce-gentle {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

@keyframes sound-wave {
  0%, 100% {
    height: 2rem;
    opacity: 0.3;
  }
  50% {
    height: 3rem;
    opacity: 1;
  }
}

/* Animation Classes */
.animate-gradient-shift {
  animation: gradient-shift 20s ease-in-out infinite;
}

.animate-gradient-shift-reverse {
  animation: gradient-shift-reverse 25s ease-in-out infinite;
}

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

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

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

.animate-rotate-3d {
  animation: rotate-3d 20s linear infinite;
}

.animate-rotate-3d-reverse {
  animation: rotate-3d-reverse 25s linear infinite;
}

.animate-rotate-3d-slow {
  animation: rotate-3d-slow 30s linear infinite;
}

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

.animate-gradient-flow {
  background-size: 200% 200%;
  animation: gradient-flow 5s ease infinite;
}

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

.animate-float-gentle-reverse {
  animation: float-gentle-reverse 25s ease-in-out infinite;
}

.animate-bounce-gentle {
  animation: bounce-gentle 2s ease-in-out infinite;
}

.animate-sound-wave {
  animation: sound-wave 1s ease-in-out infinite;
}

/* Transform Style for 3D */
.transform-style-3d {
  transform-style: preserve-3d;
}

/* Backdrop Filter Support */
@supports (backdrop-filter: blur(1px)) {
  .backdrop-blur-sm {
    backdrop-filter: blur(4px);
  }
  .backdrop-blur {
    backdrop-filter: blur(8px);
  }
  .backdrop-blur-xl {
    backdrop-filter: blur(24px);
  }
  .backdrop-blur-2xl {
    backdrop-filter: blur(40px);
  }
}

/* Fallback for browsers without backdrop-filter */
@supports not (backdrop-filter: blur(1px)) {
  .backdrop-blur-sm,
  .backdrop-blur,
  .backdrop-blur-xl,
  .backdrop-blur-2xl {
    background-color: rgba(0, 0, 0, 0.5);
  }
}

/* Driver ETA Smooth Transitions */
@keyframes eta-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes eta-fade-out {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
  }
}

@keyframes eta-number-change {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(0.95);
    opacity: 0.5;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

[data-driver-eta-target="content"],
[data-driver-eta-target="loading"],
[data-driver-eta-target="error"] {
  will-change: opacity;
  backface-visibility: hidden;
  -webkit-font-smoothing: antialiased;
}

[data-driver-eta-target="etaMinutes"],
[data-driver-eta-target="remainingStops"] {
  display: inline-block;
  will-change: transform, opacity;
  backface-visibility: hidden;
}

[data-driver-eta-target="etaContainer"] {
  contain: layout style;
}

/* Smooth color transitions for confidence labels */
[data-driver-eta-target="confidenceLabel"] {
  transition: color 300ms ease-in-out, background-color 300ms ease-in-out;
}

/* Landing Page: Grain texture overlay */
.grain-overlay {
  position: relative;
}

.grain-overlay::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* Landing Page: Typing indicator animation */
@keyframes typing-dot {
  0%, 60%, 100% {
    opacity: 0.3;
    transform: translateY(0);
  }
  30% {
    opacity: 1;
    transform: translateY(-4px);
  }
}

.typing-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: #78716c; /* stone-500 */
  animation: typing-dot 1.4s infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

/* Dark mode typing dots */
.dark .typing-dot {
  background-color: #a8a29e; /* stone-400 for visibility on dark bubble bg */
}

/* Customer typing dot color */
.typing-dot--customer {
  background-color: var(--color-brand);
}

.dark .typing-dot--customer {
  background-color: var(--color-brand-light);
}

/* Grain overlay dark mode */
.dark .grain-overlay::before {
  opacity: 0.06;
  filter: invert(1);
}

/* Landing Page: Chat bubble entrance */
@keyframes chat-bubble-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.chat-bubble-animate {
  animation: chat-bubble-in 0.4s ease-out forwards;
}

/* Landing Page: Phone ring pulse */
@keyframes phone-ring {
  0%, 100% {
    transform: rotate(0deg);
  }
  10% {
    transform: rotate(15deg);
  }
  20% {
    transform: rotate(-13deg);
  }
  30% {
    transform: rotate(10deg);
  }
  40% {
    transform: rotate(-8deg);
  }
  50% {
    transform: rotate(0deg);
  }
}

.animate-phone-ring {
  animation: phone-ring 2s ease-in-out infinite;
  transform-origin: center center;
}

@keyframes ring-pulse {
  0% {
    transform: scale(1);
    opacity: 0.6;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

.animate-ring-pulse {
  animation: ring-pulse 2s ease-out infinite;
}

/* Import component stylesheets */
@import url("/assets/components/driver_map-60a971e6.css");
