/* =====================================================
   FedFX / Supporter Delivery Design System
   Exact match to sample: feeedexdelivery.joinisrguide.online
   Font: Figtree (300, 400, 500, 600, 700)
   Brand Colors:
     - Brand Deep Purple: #400B81
     - Primary Orange/Accent: #e77728
     - Link Blue: #0d63cc
     - Muted Background: #f6f7f9
     - Border Line: #dfe3e8
     - Foreground/Ink: #30343b
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Figtree:wght@300;400;500;600;700;800&display=swap');

:root {
  --font-family: 'Figtree', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  
  --brand: #400B81;
  --brand-foreground: #ffffff;
  --brand-hover: #330868;

  --primary: #e77728;
  --primary-foreground: #ffffff;
  --primary-hover: #d2651b;

  --link: #0d63cc;
  --link-hover: #094ca3;

  --foreground: #30343b;
  --muted: #f6f7f9;
  --muted-foreground: #68717d;
  --border: #dfe3e8;
  --background: #ffffff;

  --radius: 0.25rem;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --shadow-md: 0 4px 12px rgba(48,52,59,0.08);
  --shadow-lg: 0 10px 30px rgba(64,11,129,0.12);
}

/* Base resets */
* {
  box-sizing: border-box;
}

body {
  font-family: var(--font-family);
  color: var(--foreground);
  background-color: var(--background);
  margin: 0;
  padding: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
}

a {
  color: var(--link);
  text-decoration: none;
}
a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

/* Typography styles matching the sample */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-family);
  color: inherit;
  font-weight: 600;
  margin-top: 0;
}

.font-light {
  font-weight: 300 !important;
}

.text-brand { color: var(--brand) !important; }
.text-primary { color: var(--primary) !important; }
.text-link { color: var(--link) !important; }
.text-muted-foreground { color: var(--muted-foreground) !important; }

.bg-brand { background-color: var(--brand) !important; color: var(--brand-foreground) !important; }
.bg-primary { background-color: var(--primary) !important; color: var(--primary-foreground) !important; }
.bg-muted { background-color: var(--muted) !important; }
.border-border { border-color: var(--border) !important; }

/* Header & Navigation Bar matching Sample */
.site-header {
  background-color: var(--brand);
  color: var(--brand-foreground);
  position: sticky;
  top: 0;
  z-index: 40;
}

.site-header-inner {
  max-width: 1024px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.05em;
  color: #ffffff;
  display: flex;
  align-items: baseline;
  text-decoration: none;
}
.site-logo:hover {
  text-decoration: none;
  color: #ffffff;
}

.site-logo .logo-accent {
  color: var(--primary);
  margin-left: 0;
}

.header-nav-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.header-link-btn {
  color: #ffffff;
  font-size: 0.875rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  font-family: var(--font-family);
}
.header-link-btn:hover {
  color: #ffffff;
  opacity: 0.9;
  text-decoration: none;
}

.nav-text-mobile {
  display: none;
}

.header-icon-btn {
  background: none;
  border: none;
  color: #ffffff;
  cursor: pointer;
  padding: 0.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Mobile & Slideout Navigation Drawer */
.site-menu-drawer {
  position: fixed;
  inset: 0;
  top: 68px;
  z-index: 50;
  display: flex;
}

.site-menu-nav {
  height: 100%;
  width: 83.333333%;
  max-width: 24rem;
  overflow-y: auto;
  background-color: var(--background);
  border-right: 1px solid var(--border);
  box-shadow: 4px 0 24px rgba(0,0,0,0.15);
}

.site-menu-item {
  border-bottom: 1px solid var(--border);
}

.site-menu-btn {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 2rem;
  text-align: left;
  font-size: 1rem;
  font-weight: 600;
  background: none;
  border: none;
  color: var(--foreground);
  cursor: pointer;
  font-family: var(--font-family);
}

.site-menu-subitems {
  padding-bottom: 0.75rem;
}

.site-menu-sublink {
  display: block;
  padding: 0.5rem 3rem;
  font-size: 0.875rem;
  color: var(--link);
}
.site-menu-sublink:hover {
  text-decoration: underline;
}

.site-menu-backdrop {
  flex: 1;
  background-color: rgba(48,52,59,0.4);
  border: none;
  cursor: pointer;
}

/* Notice / Help Banner */
.help-banner {
  margin-top: 1.5rem;
  display: flex;
  gap: 1rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand);
  padding: 1rem;
  background-color: #ffffff;
}

/* Big Hero Track Banner Link */
.track-banner-btn {
  margin-top: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background-color: var(--brand);
  padding: 1.25rem;
  color: var(--brand-foreground) !important;
  border-radius: var(--radius);
  text-decoration: none;
  transition: background-color 0.15s ease;
}
.track-banner-btn:hover {
  background-color: var(--brand-hover);
  text-decoration: none;
  color: var(--brand-foreground) !important;
}

/* Ticket / Tracking Lookup Form (Exact sample replica) */
.ticket-lookup-wrap {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.ticket-input-group {
  display: flex;
  flex: 1;
  border: 1px solid var(--border);
  background: #ffffff;
  border-radius: var(--radius);
}

.ticket-input-field {
  min-width: 0;
  flex: 1;
  padding: 0.75rem 1rem;
  outline: none;
  border: none;
  font-family: var(--font-family);
  font-size: 1rem;
  color: var(--foreground);
}

.ticket-input-icon {
  display: flex;
  align-items: center;
  border-left: 1px solid var(--border);
  padding: 0 0.85rem;
  color: var(--link);
}

.btn-check-now {
  border: 2px solid var(--primary);
  background: transparent;
  color: var(--primary);
  padding: 0 1.25rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.875rem;
  cursor: pointer;
  border-radius: var(--radius);
  transition: all 0.15s ease;
  font-family: var(--font-family);
}
.btn-check-now:hover {
  background-color: var(--primary);
  color: #ffffff;
}

/* Sample Quick Number Buttons */
.sample-num-btn {
  background: none;
  border: none;
  padding: 0;
  margin-right: 0.75rem;
  text-decoration: underline;
  text-underline-offset: 2px;
  color: inherit;
  cursor: pointer;
  font-family: var(--font-family);
  font-size: 0.875rem;
}
.sample-num-btn:hover {
  color: var(--foreground);
}

/* Ticket/Shipment Result Card (Exact replica of sample) */
.ticket-result-box {
  margin-top: 1.25rem;
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  padding: 1.5rem;
  background-color: #ffffff;
  border-radius: var(--radius);
}

/* Receiving Resource Box */
.receiving-box {
  margin-top: 1.5rem;
  background-color: var(--muted);
  padding: 1.5rem;
  border-radius: var(--radius);
}

.receiving-list {
  list-style: none;
  margin: 1.25rem 0 0 0;
  padding: 0;
}
.receiving-list li {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1.15rem;
  font-size: 1rem;
}

.divider-line {
  margin: 1.5rem 0;
  height: 1px;
  background-color: var(--border);
}

/* Floating AI Chatbot trigger button */
.chat-fab-btn {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 50;
  border-radius: 9999px;
  background-color: var(--brand);
  color: var(--brand-foreground);
  padding: 1rem;
  box-shadow: 0 10px 25px -5px rgba(64,11,129,0.4);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background-color 0.2s ease;
}
.chat-fab-btn:hover {
  transform: scale(1.05);
  background-color: var(--brand-hover);
}

/* Chatbot Popup Container */
.chatbot-panel {
  position: fixed;
  bottom: 5.5rem;
  right: 1.5rem;
  width: 375px;
  max-width: calc(100vw - 2rem);
  height: 520px;
  max-height: calc(100vh - 7rem);
  background-color: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 35px rgba(0,0,0,0.18);
  z-index: 50;
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.chatbot-panel.active {
  display: flex;
}

.chat-panel-header {
  background-color: var(--brand);
  color: #ffffff;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-messages-container {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  background-color: #fafbfc;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chat-msg {
  max-width: 85%;
  padding: 0.65rem 0.95rem;
  border-radius: 8px;
  font-size: 0.875rem;
  line-height: 1.45;
}
.chat-msg.bot {
  background-color: #ffffff;
  border: 1px solid var(--border);
  color: var(--foreground);
  align-self: flex-start;
  border-top-left-radius: 2px;
}
.chat-msg.user {
  background-color: var(--brand);
  color: #ffffff;
  align-self: flex-end;
  border-top-right-radius: 2px;
}

.chat-input-row {
  display: flex;
  border-top: 1px solid var(--border);
  background: #ffffff;
  padding: 0.5rem;
}
.chat-input-row input {
  flex: 1;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 0.75rem;
  outline: none;
  font-family: var(--font-family);
  font-size: 0.875rem;
}
.chat-input-row button {
  background-color: var(--primary);
  color: #ffffff;
  border: none;
  border-radius: 6px;
  margin-left: 0.5rem;
  padding: 0 0.85rem;
  cursor: pointer;
}

/* Modals */
.modal-backdrop-custom {
  position: fixed;
  inset: 0;
  background-color: rgba(48,52,59,0.5);
  backdrop-filter: blur(2px);
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-content-custom {
  background: #ffffff;
  border-radius: 8px;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 20px 40px rgba(0,0,0,0.2);
  border: 1px solid var(--border);
  overflow: hidden;
}
.modal-header-custom {
  background-color: var(--brand);
  color: #ffffff;
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-body-custom {
  padding: 1.5rem;
}

/* Form Styles */
.form-label-custom {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  color: var(--foreground);
}
.form-input-custom {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem 0.85rem;
  font-family: var(--font-family);
  font-size: 0.95rem;
  outline: none;
  margin-bottom: 1rem;
}
.form-input-custom:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(64,11,129,0.15);
}

.btn-primary-block {
  width: 100%;
  background-color: var(--brand);
  color: #ffffff;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background-color 0.15s ease;
  font-family: var(--font-family);
}
.btn-primary-block:hover {
  background-color: var(--brand-hover);
}

/* Tracking Timeline Steps */
.timeline-stepper {
  position: relative;
  padding-left: 2rem;
  margin-top: 1.5rem;
}
.timeline-stepper::before {
  content: '';
  position: absolute;
  left: 0.5rem;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 2px;
  background-color: var(--border);
}
.timeline-step {
  position: relative;
  margin-bottom: 1.75rem;
}
.timeline-dot {
  position: absolute;
  left: -2rem;
  top: 0.25rem;
  width: 1rem;
  height: 1rem;
  border-radius: 9999px;
  border: 2px solid #ffffff;
  background-color: var(--border);
  box-shadow: 0 0 0 2px var(--border);
}
.timeline-step.active .timeline-dot {
  background-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary);
}
.timeline-step.completed .timeline-dot {
  background-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand);
}

/* Ticket Support Conversation Area */
.ticket-chat-card {
  margin-top: 1.5rem;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(48,52,59,0.06);
  overflow: hidden;
}
.ticket-chat-header {
  background: #fafafa;
  border-bottom: 1px solid var(--border);
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.ticket-chat-body {
  padding: 1.25rem;
  background: #fdfdfd;
  max-height: 380px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.ticket-bubble {
  max-width: 82%;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  line-height: 1.45;
  position: relative;
}
.ticket-bubble.agent {
  align-self: flex-start;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  color: var(--foreground);
}
.ticket-bubble.user {
  align-self: flex-end;
  background: var(--brand);
  color: #ffffff;
}
.ticket-bubble.system {
  align-self: center;
  max-width: 95%;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  font-size: 0.85rem;
}
.ticket-bubble-meta {
  font-size: 0.7rem;
  opacity: 0.8;
  margin-bottom: 0.25rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.ticket-chat-input-wrap {
  padding: 0.85rem 1.25rem;
  background: #ffffff;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 0.75rem;
  align-items: center;
}
.ticket-chat-input {
  flex: 1;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-family);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s;
}
.ticket-chat-input:focus {
  border-color: var(--brand);
}
.btn-ticket-send {
  background: var(--primary);
  color: #ffffff;
  border: none;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600;
  cursor: pointer;
  font-family: var(--font-family);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: background-color 0.15s;
}
.btn-ticket-send:hover {
  background: var(--primary-hover);
}

/* Tracking Details Cards */
.shipment-details-card {
  border: 1px solid var(--border);
  padding: 1.75rem;
  border-radius: var(--radius);
  background: #ffffff;
}
.shipment-dl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.5rem;
  margin: 0;
}

/* =====================================================
   Comprehensive Mobile & Tablet Responsive Enhancements
   ===================================================== */
@media (max-width: 768px) {
  .site-header-inner {
    padding: 1rem 1.25rem;
  }
  .track-banner-btn {
    padding: 1rem;
  }
  .receiving-box {
    padding: 1.5rem 1.25rem;
  }
  main {
    padding: 0 1rem 4rem 1rem !important;
  }
}

@media (max-width: 576px) {
  /* Navbar */
  .site-header-inner {
    padding: 0.75rem 1rem;
  }
  .site-logo {
    font-size: 1.5rem;
  }
  .header-nav-actions {
    gap: 0.65rem;
  }
  .header-link-btn {
    font-size: 0.8rem;
    gap: 0.35rem;
    white-space: nowrap;
  }
  .nav-text-desktop {
    display: none !important;
  }
  .nav-text-mobile {
    display: inline !important;
  }
  .header-icon-btn {
    padding: 0.25rem;
  }

  /* Form & Lookup */
  .ticket-lookup-wrap {
    flex-direction: column;
    gap: 0.65rem;
  }
  .btn-check-now {
    width: 100%;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem;
  }

  /* Chatbot panel on phone */
  .chatbot-panel {
    right: 0.75rem;
    left: 0.75rem;
    bottom: 5.25rem;
    width: auto;
    max-width: calc(100vw - 1.5rem);
    height: calc(100dvh - 6.5rem);
    max-height: 520px;
    border-radius: 10px;
  }
  .chat-fab-btn {
    bottom: 1.25rem;
    right: 1.25rem;
    width: 50px;
    height: 50px;
  }

  /* Ticket Chat Card */
  .ticket-chat-card {
    margin-top: 1rem;
  }
  .ticket-chat-header {
    padding: 0.85rem 1rem;
  }
  .ticket-chat-body {
    padding: 1rem 0.85rem;
    max-height: 320px;
  }
  .ticket-bubble {
    max-width: 90%;
    font-size: 0.85rem;
    padding: 0.75rem 0.85rem;
  }
  .ticket-chat-input-wrap {
    padding: 0.65rem 0.75rem;
    gap: 0.5rem;
  }
  .ticket-chat-input {
    font-size: 0.875rem;
    padding: 0.65rem 0.75rem;
  }
  .btn-ticket-send {
    padding: 0.65rem 0.85rem;
    font-size: 0.85rem;
  }

  /* Modal */
  .modal-backdrop-custom {
    padding: 0.75rem;
  }
  .modal-content-custom {
    max-height: 92vh;
    overflow-y: auto;
    border-radius: 8px;
  }
  .modal-header-custom {
    padding: 1rem 1.25rem;
  }
  .modal-body-custom {
    padding: 1.25rem;
  }
  .modal-grid-2col {
    grid-template-columns: 1fr !important;
    gap: 0.5rem !important;
  }

  /* Auth page / Login */
  .auth-page-container {
    padding: 1.25rem 0.75rem;
  }
  .auth-card-body {
    padding: 1.25rem 1.25rem 1.5rem 1.25rem;
  }

  /* Tracking Details Cards */
  .shipment-details-card {
    padding: 1.25rem 1rem !important;
  }
  .shipment-dl-grid {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)) !important;
    gap: 1rem !important;
  }
}
