/**
 * Worldin Express - Enhanced UI/UX Stylesheet
 * Version: v1.0.0
 * Date: 2026-01-23
 * 
 * Custom enhancements for modern logistics website
 * - Animations & Transitions
 * - Unified Button Styles
 * - Enhanced Cards & Hover Effects
 * - Responsive Improvements
 * - Professional Typography
 */

/* ========================================
   CSS CUSTOM PROPERTIES (DESIGN TOKENS)
   ======================================== */
:root {
  /* Primary Colors */
  --color-primary: #d70f0f;
  --color-primary-dark: #b50d0d;
  --color-primary-light: #ff2222;
  
  /* Secondary Colors */
  --color-secondary: #1a1a2e;
  --color-secondary-light: #16213e;
  
  /* Accent Colors */
  --color-accent: #0f3460;
  --color-accent-light: #e94560;
  
  /* Neutral Colors */
  --color-gray-50: #f9fafb;
  --color-gray-100: #f3f4f6;
  --color-gray-200: #e5e7eb;
  --color-gray-300: #d1d5db;
  --color-gray-500: #6b7280;
  --color-gray-700: #374151;
  --color-gray-900: #111827;
  
  /* Typography */
  --font-heading: 'Poppins', sans-serif;
  --font-body: 'Poppins', sans-serif;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-primary: 0 10px 40px -10px rgba(215, 15, 15, 0.4);
  
  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-normal: 300ms ease;
  --transition-slow: 500ms ease;
  
  /* Border Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;
}

/* ========================================
   GLOBAL ENHANCEMENTS
   ======================================== */

/* Safer sizing model to prevent mobile overflow on inputs/selects (Contact/Track) */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

/* Selection Color */
::selection {
  background-color: var(--color-primary);
  color: white;
}

/* Focus States for Accessibility */
*:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ========================================
   NAVIGATION ENHANCEMENTS
   ======================================== */

/* Sticky Header with Blur Effect on Scroll */
nav.bg-white.sticky {
  transition: background-color var(--transition-normal), 
              box-shadow var(--transition-normal),
              backdrop-filter var(--transition-normal);
}

nav.bg-white.sticky.scrolled {
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: var(--shadow-lg);
}

/* Navigation Links Hover Effect */
.link[data-astro-cid-ieyx6y3k] {
  position: relative;
  transition: color var(--transition-normal);
}

.link[data-astro-cid-ieyx6y3k]::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent-light));
  transition: width var(--transition-normal), left var(--transition-normal);
}

.link[data-astro-cid-ieyx6y3k]:hover::after,
.link[data-astro-cid-ieyx6y3k].active::after {
  width: 80%;
  left: 10%;
}

/* Mobile Menu Animation */
@media (max-width: 767px) {
  /* Hide desktop nav on mobile */
  #navbar-desktop {
    display: none !important;
  }
  
  /* Mobile Nav Overlay - High z-index */
  .mobile-nav-overlay {
    position: fixed !important;
    inset: 0 !important;
    background: rgba(0, 0, 0, 0.5) !important;
    z-index: 9998 !important;
    opacity: 0;
    transition: opacity var(--transition-normal);
    pointer-events: none;
  }
  
  .mobile-nav-overlay.active {
    opacity: 1;
    pointer-events: auto;
  }
  
  /* Mobile Nav Menu - Highest z-index, right aligned, half screen width */
  .mobile-nav-menu {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    left: auto !important;
    width: 70% !important;
    max-width: 300px !important;
    height: 100vh !important;
    background: white !important;
    z-index: 9999 !important;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.2) !important;
    transition: transform 0.3s ease-out;
    overflow-y: auto;
  }
  
  .mobile-nav-menu:not(.active) {
    transform: translateX(100%) !important;
  }
  
  .mobile-nav-menu.active {
    transform: translateX(0) !important;
  }
  
  /* Mobile Nav Item Animation */
  .mobile-nav-item {
    opacity: 0;
    transform: translateX(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
  }
  
  .mobile-nav-menu.active .mobile-nav-item {
    opacity: 1;
    transform: translateX(0);
  }
  
  .mobile-nav-menu.active .mobile-nav-item:nth-child(1) { transition-delay: 0.05s; }
  .mobile-nav-menu.active .mobile-nav-item:nth-child(2) { transition-delay: 0.1s; }
  .mobile-nav-menu.active .mobile-nav-item:nth-child(3) { transition-delay: 0.15s; }
  .mobile-nav-menu.active .mobile-nav-item:nth-child(4) { transition-delay: 0.2s; }
  .mobile-nav-menu.active .mobile-nav-item:nth-child(5) { transition-delay: 0.25s; }
  .mobile-nav-menu.active .mobile-nav-item:nth-child(6) { transition-delay: 0.3s; }
  .mobile-nav-menu.active .mobile-nav-item:nth-child(7) { transition-delay: 0.35s; }
}

@media (min-width: 768px) {
  /* Show desktop nav on larger screens */
  #navbar-desktop {
    display: flex !important;
  }
  
  /* Hide mobile nav elements on desktop */
  .mobile-nav-menu,
  .mobile-nav-overlay,
  #nav-button {
    display: none !important;
  }
}

/* ========================================
   BUTTON STYLES (UNIFIED ROUNDED-LG)
   ======================================== */

/* Base Button Style */
button,
.submit-btn,
input[type="submit"],
a.block.bg-white {
  border-radius: var(--radius-lg) !important;
  transition: all var(--transition-normal) !important;
}

/* Primary Button Enhancement */
button.bg-primary,
button.border-primary,
.submit-btn {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg) !important;
}

button.bg-primary::before,
button.border-primary::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 ease;
}

button.bg-primary:hover::before,
button.border-primary:hover::before {
  left: 100%;
}

/* Button Hover Scale Effect */
button:hover,
.submit-btn:hover,
input[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

button:active,
.submit-btn:active {
  transform: translateY(0);
}

/* White/Light Buttons */
button.bg-white {
  border-radius: var(--radius-lg) !important;
}

button.bg-white:hover {
  box-shadow: var(--shadow-primary);
}

/* ========================================
   HERO SECTION ENHANCEMENTS
   ======================================== */

/* Hero Background Overlay Gradient */
.dark-overlay[data-astro-cid-hxxqyo2u] {
  background: linear-gradient(
    135deg,
    rgba(0, 0, 0, 0.7) 0%,
    rgba(26, 26, 46, 0.6) 50%,
    rgba(215, 15, 15, 0.3) 100%
  );
}

/* Hero Text Animation */
.astro-component.fade-in h1 {
  animation: slideInUp 0.8s ease-out;
}

.astro-component.fade-in h2 {
  animation: slideInUp 0.8s ease-out 0.2s both;
}

.astro-component.fade-in .flex > a {
  animation: slideInUp 0.8s ease-out 0.4s both;
}

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

/* Hero Scroll Indicator */
.hero-scroll-indicator {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  animation: bounce 2s infinite;
}

@keyframes bounce {
  0%, 20%, 50%, 80%, 100% {
    transform: translateX(-50%) translateY(0);
  }
  40% {
    transform: translateX(-50%) translateY(-10px);
  }
  60% {
    transform: translateX(-50%) translateY(-5px);
  }
}

/* ========================================
   CARD ENHANCEMENTS
   ======================================== */

/* Service Cards & Blog Cards */
.hover\:bg-gray-200:hover,
.hover\:bg-gray-100:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

/* Blog Card Hover Effect */
.p-5.max-md\:text-center.hover\:bg-gray-100 {
  transition: all var(--transition-normal);
  border-radius: var(--radius-xl);
}

.p-5.max-md\:text-center.hover\:bg-gray-100:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px -15px rgba(215, 15, 15, 0.25);
}

/* Blog Card Image Zoom */
.p-5.max-md\:text-center.hover\:bg-gray-100 img {
  transition: transform var(--transition-slow);
}

.p-5.max-md\:text-center.hover\:bg-gray-100:hover img {
  transform: scale(1.05);
}

/* Pricing Cards */
.border-2.border-primary.hover\:bg-gray-200 {
  transition: all var(--transition-normal);
}

.border-2.border-primary.hover\:bg-gray-200:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: var(--shadow-primary);
  border-color: var(--color-primary-dark);
}

/* Career Job Cards */
a.block.bg-white.rounded-xl {
  transition: all var(--transition-normal);
}

a.block.bg-white.rounded-xl:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
  border-color: var(--color-primary);
}

/* ========================================
   SCROLL ANIMATIONS
   ======================================== */

/* Fade In On Scroll */
.item-container[data-astro-cid-j7pv25f6] {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.item-container[data-astro-cid-j7pv25f6].show {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered Animation for Grid Items */
.grid > *:nth-child(1) { transition-delay: 0.1s; }
.grid > *:nth-child(2) { transition-delay: 0.2s; }
.grid > *:nth-child(3) { transition-delay: 0.3s; }
.grid > *:nth-child(4) { transition-delay: 0.4s; }
.grid > *:nth-child(5) { transition-delay: 0.5s; }
.grid > *:nth-child(6) { transition-delay: 0.6s; }
.grid > *:nth-child(7) { transition-delay: 0.7s; }

/* ========================================
   TRUST LOGOS SECTION
   ======================================== */

/* Logo Grayscale to Color on Hover */
.cell[data-astro-cid-6gpo3hvp] img {
  filter: grayscale(100%);
  opacity: 0.6;
  transition: all var(--transition-normal);
}

.cell[data-astro-cid-6gpo3hvp]:hover img {
  filter: grayscale(0%);
  opacity: 1;
  transform: scale(1.1);
}

/* ========================================
   TESTIMONIAL SECTION
   ======================================== */

.bg-primary > .flex > .max-w-5xl {
  position: relative;
}

/* Quote Mark Decoration */
.bg-primary .text-xl.italic::before {
  content: '"';
  font-size: 4rem;
  font-family: Georgia, serif;
  position: absolute;
  top: -20px;
  left: -30px;
  opacity: 0.3;
  color: white;
}

/* ========================================
   FORM ENHANCEMENTS
   ======================================== */

/* Keep native form controls within the viewport on mobile */
.form-control {
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}

/* Prevent select text from pushing width beyond screen on some mobile browsers */
select.form-control {
  min-width: 0;
}

/* ========================================
   TRACK SEARCH (CENTERED + RESPONSIVE)
   ======================================== */

/* Keep the track search form centered and reasonably sized on desktop,
   while remaining full-width on mobile. */
.track-search-container {
  width: 100%;
  margin-left: auto;
  margin-right: auto;
}

.soft-form-show-page {
  width: 100%;
  display: flex;
  justify-content: center;
}

.soft-form-view {
  width: 100%;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
}

/* Search Box Wrapper */
.search-box-wrapper {
  width: 100%;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  border-radius: var(--radius-xl) !important;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.06);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  transform: translateY(0);
  transition: transform var(--transition-normal), box-shadow var(--transition-normal), border-color var(--transition-normal);
}

/* Desktop: ensure input expands and the submit button stays on the RIGHT */
.track-search-container .search-box-wrapper {
  display: flex !important;
  align-items: stretch;
}

.track-search-container .search-box-wrapper .form-input-div {
  flex: 1 1 auto;
  min-width: 0; /* important for flex overflow */
}

.track-search-container .search-box-wrapper input[name="order_track"] {
  width: 100%;
  min-width: 0;
}

.track-search-container .search-box-wrapper .submit-btn {
  flex: 0 0 auto;
}

/* Slight “lift” on hover for desktop */
@media (hover: hover) and (pointer: fine) {
  .search-box-wrapper:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-xl);
  }
}

/* Entrance animation */
@keyframes fadeInUp {
  0% { opacity: 0; transform: translateY(10px); }
  100% { opacity: 1; transform: translateY(0); }
}

.track-search-container .search-box-wrapper {
  animation: fadeInUp 450ms ease both;
}

@media (prefers-reduced-motion: reduce) {
  .track-search-container .search-box-wrapper {
    animation: none;
  }
  .search-box-wrapper,
  .search-box-wrapper:hover {
    transition: none;
    transform: none;
  }
}

/* Tracking results brief highlight (for auto-scroll) */
.our-history-container.track-results-focus {
  animation: trackPulse 900ms ease both;
}

@keyframes trackPulse {
  0% { box-shadow: 0 0 0 0 rgba(215, 15, 15, 0.0); }
  35% { box-shadow: 0 0 0 6px rgba(215, 15, 15, 0.18); }
  100% { box-shadow: 0 0 0 0 rgba(215, 15, 15, 0.0); }
}

@media (prefers-reduced-motion: reduce) {
  .our-history-container.track-results-focus {
    animation: none;
  }
}

/* Input Focus States */
input.form-control,
select.form-control,
textarea.form-control {
  transition: all var(--transition-normal);
  border-radius: var(--radius-md) !important;
}

input.form-control:focus,
select.form-control:focus,
textarea.form-control:focus {
  border-color: var(--color-primary) !important;
  box-shadow: 0 0 0 3px rgba(215, 15, 15, 0.15);
  outline: none;
}

/* Track Search Box */
.form-input-div input[name="order_track"] {
  padding-left: 1.25rem;
  padding-right: 1.25rem;
  font-size: 1rem;
}

.search-box-wrapper:focus-within {
  border-color: var(--color-primary) !important;
  box-shadow: 0 4px 20px rgba(215, 15, 15, 0.15) !important;
}

.search-box-wrapper .submit-btn {
  border-radius: 0 !important;
  white-space: nowrap;
  transform: translateY(0);
}

.search-box-wrapper .submit-btn:active {
  transform: translateY(1px);
}

.search-box-wrapper input[name="order_track"] {
  border-radius: 0 !important;
}

/* ========================================
   TRACKING RESULTS ENHANCEMENT
   ======================================== */

/* Timeline Animation - Visible by default with subtle entrance animation */
.our-history-line .accordion.accordion-grey {
  opacity: 1;
  animation: fadeInLeft 0.5s ease both;
}

.our-history-line .accordion.accordion-grey:nth-child(1) { animation-delay: 0.05s; }
.our-history-line .accordion.accordion-grey:nth-child(2) { animation-delay: 0.1s; }
.our-history-line .accordion.accordion-grey:nth-child(3) { animation-delay: 0.15s; }
.our-history-line .accordion.accordion-grey:nth-child(4) { animation-delay: 0.2s; }
.our-history-line .accordion.accordion-grey:nth-child(5) { animation-delay: 0.25s; }
.our-history-line .accordion.accordion-grey:nth-child(6) { animation-delay: 0.3s; }
.our-history-line .accordion.accordion-grey:nth-child(7) { animation-delay: 0.35s; }
.our-history-line .accordion.accordion-grey:nth-child(8) { animation-delay: 0.4s; }
.our-history-line .accordion.accordion-grey:nth-child(9) { animation-delay: 0.45s; }
.our-history-line .accordion.accordion-grey:nth-child(10) { animation-delay: 0.5s; }

@keyframes fadeInLeft {
  0% {
    opacity: 0;
    transform: translateX(-15px);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

/* Timeline Line Gradient */
.our-history-line {
  border-left: 3px solid;
  border-image: linear-gradient(180deg, var(--color-primary), var(--color-secondary)) 1;
}

/* Delivery Info Cards */
.delivery-ship > div > div {
  transition: all var(--transition-normal);
}

.delivery-ship > div > div:hover {
  background: var(--color-gray-100);
  transform: translateX(5px);
}

/* ========================================
   FOOTER ENHANCEMENTS
   ======================================== */

/* Footer Wave Separator */
#footer::before {
  content: '';
  display: block;
  width: 100%;
  height: 60px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 100'%3E%3Cpath fill='%23d70f0f' d='M0,50 C360,100 720,0 1080,50 C1260,75 1350,100 1440,100 L1440,100 L0,100 Z'/%3E%3C/svg%3E") no-repeat center;
  background-size: cover;
  position: absolute;
  top: -59px;
  left: 0;
}

#footer {
  position: relative;
}

/* Footer Links Hover */
.footer-link {
  transition: all var(--transition-fast);
}

.footer-link:hover {
  transform: translateX(3px);
}

.footer-link:hover div {
  color: var(--color-gray-200) !important;
}

/* ========================================
   PAGE TRANSITIONS
   ======================================== */

/* Smooth Page Load */
body {
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

/* ========================================
   RESPONSIVE ENHANCEMENTS
   ======================================== */

/* Mobile Touch Targets (min 44x44px) */
@media (max-width: 935px) {
  button,
  a.link,
  input[type="submit"],
  .footer-link {
    min-height: 44px;
    min-width: 44px;
  }
  
  /* Better Mobile Card Spacing */
  .grid.gap-5,
  .grid.gap-6 {
    gap: 1.5rem;
  }
  
  /* Mobile Form Full Width */
  .form-input-div {
    width: 100%;
  }
  
  /* Mobile Hero Text Size Adjustment */
  .text-5xl {
    font-size: 2.5rem;
    line-height: 1.1;
  }
  
  /* Mobile Padding Adjustments */
  .px-20 {
    padding-left: 1rem;
    padding-right: 1rem;
  }
}

/* Tablet Adjustments */
@media (min-width: 768px) and (max-width: 1024px) {
  .max-w-5xl {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* Large Screen Enhancements */
@media (min-width: 1280px) {
  /* Subtle hover scaling for desktop */
  .hover\:bg-gray-200:hover,
  .hover\:bg-gray-100:hover {
    transform: translateY(-8px) scale(1.01);
  }
}

/* ========================================
   LOADING STATES & MICRO-INTERACTIONS
   ======================================== */

/* Button Loading State */
button.loading {
  position: relative;
  color: transparent !important;
}

button.loading::after {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  top: 50%;
  left: 50%;
  margin-top: -10px;
  margin-left: -10px;
  border: 2px solid white;
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

/* Image Load Skeleton */
img:not([src*="Logo"]):not(.logo-img) {
  background: linear-gradient(90deg, var(--color-gray-200) 25%, var(--color-gray-100) 50%, var(--color-gray-200) 75%);
  background-size: 200% 100%;
}

/* Logo - No Background */
img[src*="Logo"],
img.logo-img {
  background: transparent !important;
}

/* ========================================
   ACCESSIBILITY IMPROVEMENTS
   ======================================== */

/* 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 Support */
@media (prefers-contrast: high) {
  :root {
    --color-primary: #cc0000;
    --color-gray-500: #4a4a4a;
  }
  
  button,
  a {
    text-decoration: underline;
  }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

/* Gradient Text */
.gradient-text {
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

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

/* Smooth Rounded Images */
.rounded-xl {
  border-radius: var(--radius-xl) !important;
}

/* Enhanced Shadow on Hover */
.hover-lift {
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}

.hover-lift:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
}

