/* LybEXpress Brand Theme and Global Styles */

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

:root {
  /* Brand Colors extracted from Logo */
  --brand-primary: #006DB6;
  --brand-primary-hover: #005a96;
  --brand-accent: #003666;

  /* Neutral Surface Palette */
  --surface-bg: #f8fafc;
  --surface-card: #ffffff;
  --border-light: #e2e8f0;

  /* Typography Colors */
  --text-heading: #1e293b;
  --text-body: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;

  /* Semantic Feedback */
  --error-bg: #ffebee;
  --error-text: #c62828;

  /* Layout / Radii defaults */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

/* Base Document Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--surface-bg);
  color: var(--text-body);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--text-heading);
  font-weight: 600;
}

/* 
 * Utility Classes - UI Components
 */

/* Container aligning content dead-center on the screen */
.screen-center {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

/* Standardized Card View */
.card {
  background: var(--surface-card);
  padding: 2.5rem;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  width: 100%;
}

/* Form Layout Stack */
.form-stack {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.input-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.input-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-heading);
}

.input-field {
  padding: 0.75rem;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  color: var(--text-heading);
  background-color: var(--surface-card);
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-field:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(0, 109, 182, 0.15);
}

/* Primary Button Action */
.btn-primary {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 0.75rem 1.5rem;
  background-color: var(--brand-primary);
  color: var(--text-inverse);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--brand-primary-hover);
}

.btn-primary:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(0, 109, 182, 0.3);
}

.btn-primary:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* Danger Button */
.btn-danger {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 0.75rem 1.5rem;
  background-color: #ef4444;
  color: var(--text-inverse);
  border: none;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.btn-danger:hover {
  background-color: #dc2626;
}

/* Error Alert Box */
.alert-error {
  background-color: var(--error-bg);
  color: var(--error-text);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  border-left: 4px solid var(--error-text);
}

/* Image Utilities */
.brand-logo {
  max-width: 280px;
  display: block;
  margin: 0 auto 1.5rem auto;
}

/* ========================================================================= */
/* Phase 5: Admin Layout and Data Tables */
/* ========================================================================= */

.admin-layout {
  display: flex;
  min-height: 100vh;
  background-color: var(--surface-bg);
}

.sidebar {
  width: 260px;
  background-color: var(--brand-accent);
  color: var(--text-inverse);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
}

.sidebar .sidebar-logo .brand-logo {
  width: 100% !important;
  max-width: 100% !important;
  height: auto !important;
  object-fit: contain !important;
  display: block;
}

.sidebar-logo {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  box-sizing: border-box;
  margin-bottom: 2rem;
  border-radius: var(--radius-sm);
  background: white;
  /* Contrast box since original is dark blue */
  padding: 0.5rem;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  flex-grow: 1;
}

.sidebar-link {
  color: var(--text-inverse);
  text-decoration: none;
  font-weight: 500;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  transition: background-color 0.2s ease, opacity 0.2s;
  opacity: 0.8;
}

.sidebar-link:hover,
.sidebar-link[aria-current="page"] {
  background-color: var(--brand-primary);
  opacity: 1;
}

.main-content {
  flex-grow: 1;
  padding: 2.5rem;
  overflow-y: auto;
}

/* Data Tables */
.data-table-container {
  background: var(--surface-card);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow-x: auto;
  min-width: 100%;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.data-table th,
.data-table td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border-light);
}

.data-table th {
  background-color: #f1f5f9;
  font-weight: 600;
  color: var(--text-heading);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.data-table tr:last-child td {
  border-bottom: none;
}

.data-table tbody tr:hover {
  background-color: #f8fafc;
}

/* Status Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.65rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
  line-height: 1;
}

.badge-pending {
  background-color: #fef3c7;
  color: #b45309;
}

.badge-dispatched {
  background-color: #e0f2fe;
  color: #0369a1;
}

.badge-delivered {
  background-color: #dcfce7;
  color: #15803d;
}

.badge-lost {
  background-color: #fee2e2;
  color: #b91c1c;
}

.action-btn {
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-light);
  background: white;
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 500;
  margin-right: 0.5rem;
  transition: all 0.2s;
}

.action-btn:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}

/* ========================================================================= */
/* Phase 6: Modal Overlays and Forms */
/* ========================================================================= */

.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  animation: fadeIn 0.2s ease-out;
}

.modal-content {
  background: var(--surface-card);
  width: 100%;
  max-width: 500px;
  border-radius: var(--radius-md);
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  overflow: hidden;
  animation: slideUp 0.3s ease-out;
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-light);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.modal-header h2 {
  font-size: 1.25rem;
  color: var(--text-heading);
  margin: 0;
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1.75rem;
  font-weight: 300;
  color: var(--text-muted);
  cursor: pointer;
  line-height: 1;
  transition: color 0.2s;
}

.modal-close-btn:hover {
  color: var(--error-text);
}

.modal-body {
  padding: 1.5rem;
  max-height: 70vh;
  overflow-y: auto;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================================================= */
/* Phase 7: OTG Customer Portal (Premium Theme) */
/* ========================================================================= */

.otg-layout {
  display: flex;
  min-height: 100vh;
  /* Use a subtle background for contrast */
  background: var(--surface-bg);
}

.otg-sidebar {
  width: 260px;
  /* Premium vibrant gradient using brand primary */
  background: linear-gradient(145deg, #004d80 0%, #006DB6 100%);
  color: var(--text-inverse);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
  flex-shrink: 0;
  border-top-right-radius: 12px;
  border-bottom-right-radius: 12px;
  position: relative;
  z-index: 10;
}

.otg-sidebar-logo {
  max-width: 100%;
  margin-bottom: 2.5rem;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.9);
  padding: 0.75rem;
  backdrop-filter: blur(8px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
  transition: transform 0.3s ease;
}

.otg-sidebar-logo:hover {
  transform: translateY(-2px);
}

.otg-sidebar-logo img {
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
  display: block;
}

.otg-nav {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  flex-grow: 1;
}

.otg-nav-link {
  color: var(--text-inverse);
  text-decoration: none;
  font-weight: 500;
  padding: 0.85rem 1.25rem;
  border-radius: var(--radius-md);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.otg-nav-link:hover,
.otg-nav-link[aria-current="page"] {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  transform: translateX(4px);
}

.otg-main-content {
  flex-grow: 1;
  padding: 3rem;
  overflow-y: auto;
  position: relative;
}

/* Glassmorphic card styling specific for customer view */
.otg-card {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.5);
  padding: 2.5rem;
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
  width: 100%;
  transition: transform 0.3s, box-shadow 0.3s;
}

.otg-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

/* Enhancing dashboard headers */
.otg-header {
  font-size: 2rem;
  color: var(--brand-accent);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.otg-subheader {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-bottom: 2rem;
}