/* ============================================
   TRUST RIDE – DESIGN SYSTEM
   ============================================ */

:root {
    --primary: #0B5E75;
    --primary-dark: #094A5D;
    --primary-light: #E4F2F6;
    --accent: #E8831A;
    --accent-dark: #D47415;
    --secondary: #E4F2F6;
    --secondary-foreground: #0B5E75;
    --background: #F7FAF9;
    --foreground: #0F1C1E;
    --card: #FFFFFF;
    --muted: #EDF1F2;
    --muted-foreground: #627880;
    --destructive: #D4183D;
    --border: rgba(11, 94, 117, 0.12);
    --input: #EDF1F2;
    --ring: rgba(11, 94, 117, 0.35);
    --radius: 0.625rem;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    --shadow-hover: 0 10px 25px rgba(0, 0, 0, 0.08);
    --primary-rgb: 11, 94, 117;
}

/* ============================================
   BASE STYLES
   ============================================ */

body {
    font-family: 'Inter', sans-serif;
    background: var(--background);
    color: var(--foreground);
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-weight: 700;
}

/* ============================================
   CARDS
   ============================================ */

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    transition: all 0.2s ease;
}
.card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

/* ============================================
   BUTTONS
   ============================================ */

/* Add spring-like motion to all buttons */
button, .btn, .btn-primary, .btn-accent, .btn-secondary {
  transition: all 0.1s cubic-bezier(0.17, 0.67, 0.83, 0.67);
  transform-origin: center;
  position: relative;
}

button:active, .btn:active, .btn-primary:active, .btn-accent:active, .btn-secondary:active {
  transform: scale(0.95) translateY(2px);
  transition: transform 0.1s ease-out;
}

button:active::after, .btn:active::after, .btn-primary:active::after, .btn-accent:active::after, .btn-secondary:active::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,0.3), transparent 70%);
  opacity: 0.4;
  pointer-events: none;
  border-radius: inherit;
}

button:hover, .btn:hover, .btn-primary:hover, .btn-accent:hover, .btn-secondary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 8px 20px rgba(11, 94, 117, 0.15);
}

/* ============================================
   BUTTONS - ORIGINAL STYLES (KEEP FOR BACKGROUND COLORS)
   ============================================ */

.btn-primary {
    background: var(--primary);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    border: none;
    cursor: pointer;
}

.btn-accent {
    background: var(--accent);
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    border: none;
    cursor: pointer;
}

/* ============================================
   INPUTS
   ============================================ */

.input {
    background: var(--input);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    width: 100%;
}
.input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--ring);
}

/* ============================================
   BADGES
   ============================================ */

.badge-success {
    background: #10B981;
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 600;
}

/* ============================================
   DARK MODE (optional)
   ============================================ */

.dark {
    --background: #0F1C1E;
    --foreground: #F7FAF9;
    --card: #1A2A2D;
    --muted: #1F2F32;
    --muted-foreground: #8A9B9F;
    --border: rgba(247, 250, 249, 0.12);
    --input: #1F2F32;
}

/* ============================================
   UTILITIES
   ============================================ */

.bg-primary {
    background: var(--primary) !important;
}
.text-primary {
    color: var(--primary) !important;
}
.border-primary {
    border-color: var(--primary) !important;
}
.bg-accent {
    background: var(--accent) !important;
}
.text-accent {
    color: var(--accent) !important;
}
.bg-secondary {
    background: var(--secondary) !important;
}
.text-secondary-foreground {
    color: var(--secondary-foreground) !important;
}
.rounded-xl {
    border-radius: var(--radius) !important;
}
.shadow-card {
    box-shadow: var(--shadow) !important;
}
.shadow-card-hover:hover {
    box-shadow: var(--shadow-hover) !important;
}

/* ============================================
   RESPONSIVE TWEAKS
   ============================================ */

@media (max-width: 640px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* ============================================
   SEAT STYLES
   ============================================ */

.seat {
    cursor: pointer;
    transition: all 0.15s ease;
}
.seat.selected {
    border: 2px solid var(--primary);
    background: var(--secondary);
}
.seat.booked {
    cursor: not-allowed;
    opacity: 0.5;
    background: var(--muted);
}

/* ============================================
   GROUP 2: CARD INTERACTIONS
   ============================================ */

/* Card interactions */
.card, .trip-card, .feature-card {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.card:hover, .trip-card:hover, .feature-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 12px 28px rgba(0,0,0,0.12), 0 4px 6px rgba(0,0,0,0.08);
}

/* Add subtle inner glow on hover */
.card:hover::before, .trip-card:hover::before, .feature-card:hover::before {
  content: '';
  position: absolute;
  inset: -2px;
  background: linear-gradient(125deg, transparent 30%, rgba(11, 94, 117, 0.08) 50%, transparent 70%);
  transform: rotate(3deg);
  pointer-events: none;
  opacity: 0.4;
  border-radius: inherit;
}

/* ============================================
   GROUP 3: FORM FIELD MICRO-INTERACTIONS
   ============================================ */

/* Form field focus with underline animation */
.input,
input[type="text"],
input[type="email"],
input[type="password"],
textarea {
  position: relative;
  transition: all 0.2s ease;
}

.input::after,
input[type="text"]::after,
input[type="email"]::after,
input[type="password"]::after,
textarea::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -8px;
  width: 0;
  height: 2px;
  background: var(--primary, #0B5E75);
  transition: width 0.3s ease-out;
  pointer-events: none;
}

.input:focus::after,
input[type="text"]:focus::after,
input[type="email"]:focus::after,
input[type="password"]:focus::after,
textarea:focus::after {
  width: 100%;
}

/* Focus state glow for all interactive elements */
.input:focus,
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus,
select:focus {
  border-color: var(--primary, #0B5E75);
  box-shadow: 0 0 0 3px rgba(11, 94, 117, 0.15);
}

/* ============================================
   GROUP 4: SEAT SELECTION FEEDBACK
   ============================================ */

.seat.available {
  transition: all 0.15s cubic-bezier(0.17, 0.67, 0.83, 0.67);
}

.seat.available:hover {
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 4px 12px rgba(232, 131, 26, 0.2);
}

.seat.selected {
  animation: pulseSelect 0.4s ease-out;
}

@keyframes pulseSelect {
  0% { transform: scale(1); }
  50% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

/* ============================================
   GROUP 5: CULTURAL ELEMENTS
   ============================================ */

/* Warm accent color (Butter Yellow) for highlights */
.accent-warm {
  color: #FFD166;
}

.bg-accent-warm {
  background-color: rgba(255, 209, 102, 0.1);
}

.border-accent-warm {
  border-color: #FFD166;
}

/* Cultural pattern overlay (adire-inspired – replace with actual SVG later) */
.section-pattern {
  position: relative;
}

.section-pattern::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M30 5L5 30l25 25 25-25z' fill='none' stroke='%230B5E75' stroke-width='0.5' opacity='0.05'/%3E%3C/svg%3E");
  opacity: 0.05;
  pointer-events: none;
  background-repeat: repeat;
  background-size: 60px 60px;
  border-radius: inherit;
}

/* ============================================
   GROUP 7: LOADING STATES
   ============================================ */

/* Brand-appropriate loader */
.loader-trustride {
  display: inline-block;
  width: 48px;
  height: 48px;
  border: 4px solid #e8e8ed;
  border-top: 4px solid #0B5E75;
  border-radius: 50%;
  animation: spin 0.8s ease-in-out infinite;
}

/* Improve skeleton loaders */
.skeleton {
  background: linear-gradient(90deg, var(--muted) 25%, var(--input) 50%, var(--muted) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Enhance existing spinner if used */
.spinner {
  border-color: rgba(var(--primary-rgb), 0.3) !important;
  border-top-color: var(--primary) !important;
  width: 1.5rem !important;
  height: 1.5rem !important;
  animation: spin 0.8s linear infinite !important;
}
@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* ============================================
   GROUP 8: MISSING ANIMATIONS
   ============================================ */

/* Empty State Entrance Animation */
.empty-state {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeUp 0.6s ease forwards;
}

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Cultural Pattern Visibility - Increased opacity */
.section-pattern::before {
    opacity: 0.08; /* was 0.05 */
}

/* Global Transition Standardization */
button, .btn, .card, .seat, input, select, textarea {
    transition-duration: 0.2s;
    transition-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============================================
   GROUP 9: BRANDED LOADING ANIMATION
   ============================================ */

/* TrustRide Brand Loader */
.trustride-loader {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.loader-logo {
    position: relative;
    width: 64px;
    height: 64px;
}

.loader-icon {
    width: 100%;
    height: 100%;
    object-fit: contain;
    animation: logoPulse 1.5s ease-in-out infinite;
}

.loader-ring {
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    border: 3px solid transparent;
    border-top-color: #0B5E75;
    border-right-color: #E8831A;
    animation: ringSpin 1s linear infinite;
}

.loader-text {
    margin-top: 1rem;
    font-family: var(--font-body);
    font-size: 0.875rem;
    color: #6E6E73;
    animation: textPulse 2s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

@keyframes ringSpin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes textPulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

/* Override existing spinners to use our branded loader */
.spinner {
    display: none !important;
}
/* Hide any existing spinner implementations */
[class*="spinner"], .loading-spinner, .loader {
    display: none !important;
}

/* ============================================ */
/* LOADER DOTS                                  */
/* ============================================ */

.trustride-loader-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.4s ease;
}

.trustride-loader-overlay.fade-out {
    opacity: 0;
    pointer-events: none;
}

.loader-dots {
    display: flex;
    gap: 8px;
    margin-top: 0.75rem;
}

.loader-dots span {
    width: 8px;
    height: 8px;
    background: #0B5E75;
    border-radius: 50%;
    animation: dotBounce 1.4s ease-in-out infinite;
}

.loader-dots span:nth-child(1) { animation-delay: 0s; }
.loader-dots span:nth-child(2) { animation-delay: 0.2s; }
.loader-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.4; }
    40% { transform: scale(1); opacity: 1; }
}

/* ============================================ */
/* LIVE RIDES – CLEAN ANIMATED MAP              */
/* ============================================ */

.live-rides-section {
    position: relative;
}

.map-container {
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0,0,0,0.06);
    border: 1px solid rgba(255,255,255,0.4);
    isolation: isolate;
}

/* Route line animation */
.route-line {
    stroke-dashoffset: 1000;
    animation: drawRoute 4s ease-in-out infinite;
}

.route-line:nth-child(2) { animation-delay: 0.6s; }
.route-line:nth-child(3) { animation-delay: 1.2s; }

@keyframes drawRoute {
    0% { stroke-dashoffset: 1000; }
    50% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: -1000; }
}

/* Moving dots (vehicles) */
.moving-dot {
    position: absolute;
    width: 12px;
    height: 12px;
    background: #E8831A;
    border-radius: 50%;
    box-shadow: 0 0 20px rgba(232, 131, 26, 0.4);
    z-index: 2;
    animation: moveDot 8s ease-in-out infinite;
}

.moving-dot::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: rgba(232, 131, 26, 0.15);
    animation: dotPulse 2s ease-in-out infinite;
}

@keyframes moveDot {
    0% { top: 25%; left: 15%; }
    25% { top: 30%; left: 30%; }
    50% { top: 60%; left: 50%; }
    75% { top: 75%; left: 65%; }
    100% { top: 25%; left: 15%; }
}

@keyframes dotPulse {
    0%, 100% { transform: scale(1); opacity: 0.4; }
    50% { transform: scale(2); opacity: 0.1; }
}

/* City Markers */
.city-marker {
    position: absolute;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    z-index: 3;
}

.city-dot {
    width: 14px;
    height: 14px;
    background: #0B5E75;
    border-radius: 50%;
    border: 2px solid white;
    box-shadow: 0 0 0 4px rgba(11, 94, 117, 0.2), 0 2px 8px rgba(0,0,0,0.1);
    animation: cityPulse 2.5s ease-in-out infinite;
}

.city-name {
    margin-top: 6px;
    font-size: 0.7rem;
    font-weight: 600;
    color: #0B5E75;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(4px);
    padding: 2px 10px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.8);
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    white-space: nowrap;
}

@keyframes cityPulse {
    0%, 100% { box-shadow: 0 0 0 4px rgba(11, 94, 117, 0.2), 0 0 0 8px rgba(11, 94, 117, 0); }
    50% { box-shadow: 0 0 0 6px rgba(11, 94, 117, 0.3), 0 0 0 14px rgba(11, 94, 117, 0); }
}

/* Live counter */
#live-ride-counter {
    font-variant-numeric: tabular-nums;
    min-width: 40px;
    display: inline-block;
}

/* Responsive */
@media (max-width: 640px) {
    .map-container {
        height: 240px !important;
    }
    .city-name {
        font-size: 0.6rem;
        padding: 1px 8px;
    }
    .moving-dot {
        width: 10px;
        height: 10px;
    }
    .city-dot {
        width: 12px;
        height: 12px;
    }
}

/* ============================================ */
/* CINEMATIC CARDS – 3D TILT                    */
/* ============================================ */

.cinematic-card {
    transition: all 0.2s ease;
}

.card-3d {
    transform-style: preserve-3d;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-3d:hover {
    transform: perspective(1000px) rotateY(2deg) rotateX(-2deg) scale(1.02);
    box-shadow: 0 20px 60px rgba(0,0,0,0.12);
}

/* Gallery-style grid for cards */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

/* AOS animation overrides */
[data-aos] {
    pointer-events: none;
}

[data-aos].aos-animate {
    pointer-events: auto;
}