/* =========================================================================
   Jowhar Cargo — Global Stylesheet
   Custom styles that complement Tailwind CSS (loaded via CDN).
   Brand: Dark Teal (#0F4C5C) premium logistics identity.
   ========================================================================= */

:root {
  --jc-teal-900: #06232b;
  --jc-teal-800: #0a3641;
  --jc-teal-700: #0F4C5C; /* Primary */
  --jc-teal-600: #14657a;
  --jc-teal-500: #1c8299;
  --jc-teal-400: #3aa7bd;
  --jc-accent: #4f9cd8;   /* Soft blue accent */
  --jc-charcoal: #1f2937;
  --jc-gray: #f3f4f6;
}

/* -------------------------------------------------------------------------
   Base + Typography
   ------------------------------------------------------------------------- */
html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--jc-charcoal);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Poppins', 'Inter', sans-serif;
  letter-spacing: -0.01em;
}

/* Accessible focus indicator */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid var(--jc-accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* -------------------------------------------------------------------------
   Brand gradients & utilities
   ------------------------------------------------------------------------- */
.jc-gradient {
  background: linear-gradient(135deg, var(--jc-teal-900) 0%, var(--jc-teal-700) 55%, var(--jc-teal-500) 100%);
}

.jc-gradient-soft {
  background: linear-gradient(135deg, #0F4C5C 0%, #14657a 100%);
}

.jc-hero-overlay {
  background:
    linear-gradient(115deg, rgba(6,35,43,0.94) 0%, rgba(15,76,92,0.85) 45%, rgba(28,130,153,0.55) 100%);
}

.text-gradient {
  background: linear-gradient(90deg, #3aa7bd, #4f9cd8);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.jc-shadow-soft {
  box-shadow: 0 10px 30px -12px rgba(15, 76, 92, 0.25);
}

/* Decorative dotted / grid backgrounds */
.jc-dot-grid {
  background-image: radial-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 22px 22px;
}

/* -------------------------------------------------------------------------
   Cards & hover animations
   ------------------------------------------------------------------------- */
.jc-card {
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.35s ease, border-color 0.35s ease;
  will-change: transform;
}

.jc-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 45px -20px rgba(15, 76, 92, 0.45);
}

.jc-icon-badge {
  transition: transform 0.35s ease, background-color 0.35s ease, color 0.35s ease;
}

.jc-card:hover .jc-icon-badge {
  transform: scale(1.08) rotate(-4deg);
}

/* Underline hover for nav */
.jc-nav-link {
  position: relative;
}
.jc-nav-link::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -4px;
  height: 2px;
  width: 0;
  background: var(--jc-teal-400);
  transition: width 0.3s ease;
}
.jc-nav-link:hover::after,
.jc-nav-link.active::after {
  width: 100%;
}
.jc-nav-link.active {
  color: var(--jc-teal-700);
  font-weight: 600;
}

/* Button shine */
.jc-btn-primary {
  background: linear-gradient(135deg, #0F4C5C, #14657a);
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
}
.jc-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 26px -12px rgba(15, 76, 92, 0.7);
  filter: brightness(1.08);
}

/* -------------------------------------------------------------------------
   Scroll reveal animations
   ------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .jc-card, .jc-btn-primary { transition: none; }
}

/* -------------------------------------------------------------------------
   Loader
   ------------------------------------------------------------------------- */
#jc-loader {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--jc-teal-900);
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
#jc-loader.hidden {
  opacity: 0;
  visibility: hidden;
}
.jc-spinner {
  width: 54px;
  height: 54px;
  border: 4px solid rgba(255, 255, 255, 0.2);
  border-top-color: #3aa7bd;
  border-radius: 50%;
  animation: jc-spin 0.9s linear infinite;
}
@keyframes jc-spin {
  to { transform: rotate(360deg); }
}

/* -------------------------------------------------------------------------
   Back to top
   ------------------------------------------------------------------------- */
#jc-back-to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 60;
  opacity: 0;
  visibility: hidden;
  transform: translateY(16px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
}
#jc-back-to-top.show {
  opacity: 1;
  visibility: visible;
  transform: none;
}

/* -------------------------------------------------------------------------
   Toast notifications
   ------------------------------------------------------------------------- */
#jc-toast-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 9998;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-width: 22rem;
}
.jc-toast {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.9rem 1rem;
  border-radius: 0.85rem;
  background: #fff;
  color: var(--jc-charcoal);
  box-shadow: 0 18px 40px -16px rgba(15, 76, 92, 0.55);
  border-left: 5px solid var(--jc-teal-700);
  transform: translateX(120%);
  transition: transform 0.4s cubic-bezier(0.2, 0.9, 0.2, 1), opacity 0.4s ease;
}
.jc-toast.show { transform: translateX(0); }
.jc-toast.success { border-left-color: #16a34a; }
.jc-toast.error { border-left-color: #dc2626; }
.jc-toast.info { border-left-color: var(--jc-accent); }

/* -------------------------------------------------------------------------
   FAQ accordion
   ------------------------------------------------------------------------- */
.jc-accordion-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s ease;
}

/* -------------------------------------------------------------------------
   Mobile navigation drawer
   ------------------------------------------------------------------------- */
#jc-mobile-menu {
  transition: transform 0.35s ease;
  transform: translateX(100%);
}
#jc-mobile-menu.open {
  transform: translateX(0);
}

/* Mega menu */
.jc-mega {
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s ease;
}
.jc-has-mega:hover .jc-mega,
.jc-has-mega:focus-within .jc-mega {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* -------------------------------------------------------------------------
   Form validation states
   ------------------------------------------------------------------------- */
.jc-input {
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}
.jc-input:focus {
  border-color: var(--jc-teal-500);
  box-shadow: 0 0 0 4px rgba(28, 130, 153, 0.15);
}
.jc-input.invalid {
  border-color: #dc2626;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12);
}
.jc-error-msg {
  display: none;
  color: #dc2626;
  font-size: 0.8rem;
  margin-top: 0.3rem;
}
.jc-error-msg.show { display: block; }

/* -------------------------------------------------------------------------
   Tracking timeline
   ------------------------------------------------------------------------- */
.jc-timeline-item::before {
  content: '';
  position: absolute;
  left: 11px;
  top: 28px;
  bottom: -8px;
  width: 2px;
  background: #e5e7eb;
}
.jc-timeline-item:last-child::before { display: none; }
.jc-timeline-item.done .jc-timeline-dot {
  background: var(--jc-teal-700);
  border-color: var(--jc-teal-700);
  color: #fff;
}
.jc-timeline-item.current .jc-timeline-dot {
  background: #fff;
  border-color: var(--jc-teal-500);
  box-shadow: 0 0 0 6px rgba(28, 130, 153, 0.18);
}

/* -------------------------------------------------------------------------
   Testimonials slider
   ------------------------------------------------------------------------- */
.jc-slider-track {
  display: flex;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.jc-slide { flex: 0 0 100%; }

/* Utility: hide scrollbar for logo marquee */
.jc-no-scrollbar::-webkit-scrollbar { display: none; }
.jc-no-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }

/* Modal */
#jc-modal-backdrop {
  transition: opacity 0.3s ease, visibility 0.3s ease;
}
.jc-modal-panel {
  transition: transform 0.35s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.35s ease;
}

/* -------------------------------------------------------------------------
   Parallax sections
   ------------------------------------------------------------------------- */
.jc-parallax {
  position: relative;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-attachment: fixed;
}
/* background-attachment: fixed is janky/unsupported on most mobile browsers */
@media (max-width: 768px) {
  .jc-parallax { background-attachment: scroll; }
}
@media (prefers-reduced-motion: reduce) {
  .jc-parallax { background-attachment: scroll; }
}

/* Smooth fade-in for content images once loaded */
.jc-img {
  opacity: 0;
  transition: opacity 0.6s ease;
}
.jc-img.loaded { opacity: 1; }

/* Image placeholder shimmer for lazy images */
img.jc-lazy {
  background: linear-gradient(100deg, #e9eef0 30%, #f6f9fa 50%, #e9eef0 70%);
  background-size: 200% 100%;
  animation: jc-shimmer 1.4s infinite;
}
img.jc-lazy.loaded { animation: none; background: none; }
@keyframes jc-shimmer {
  to { background-position: -200% 0; }
}
