/**
 * Eagle Aviation - Professional Dashboard Styles
 * Modern, responsive design with professional color scheme
 */

/* ===== CSS VARIABLES - Professional Color Palette ===== */
:root {
  /* Primary Brand Colors */
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-light: #3b82f6;
  --primary-lighter: #60a5fa;
  
  /* Secondary Colors */
  --secondary: #7c3aed;
  --secondary-dark: #6d28d9;
  --accent: #f59e0b;
  --accent-dark: #d97706;
  
  /* Neutral Colors */
  --dark: #0f172a;
  --dark-secondary: #1e293b;
  --dark-tertiary: #334155;
  --gray: #64748b;
  --gray-light: #94a3b8;
  --gray-lighter: #cbd5e1;
  --gray-lightest: #e2e8f0;
  --border: #e2e8f0;
  
  /* Background Colors */
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --bg-gradient-alt: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  
  /* Status Colors */
  --success: #10b981;
  --success-dark: #059669;
  --danger: #ef4444;
  --danger-dark: #dc2626;
  --warning: #f59e0b;
  --warning-dark: #d97706;
  --info: #3b82f6;
  --info-dark: #2563eb;
  
  /* Text Colors */
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  --text-light: #94a3b8;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --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);
  
  /* Transitions */
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  
  /* Border Radius */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;
  
  /* Spacing */
  --spacing-xs: 4px;
  --spacing-sm: 8px;
  --spacing: 12px;
  --spacing-md: 16px;
  --spacing-lg: 24px;
  --spacing-xl: 32px;
  --spacing-2xl: 48px;
}

/* ===== RESET & BASE STYLES ===== */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 15px;
  min-height: 100vh;
}

/* ===== MOBILE NAVIGATION ===== */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 8px 0;
  z-index: 1000;
  box-shadow: 0 -4px 6px -1px rgba(0, 0, 0, 0.1);
}

.mobile-nav-items {
  display: flex;
  justify-content: space-around;
  align-items: center;
  max-width: 100%;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  transition: var(--transition-fast);
  border-radius: var(--radius);
  flex: 1;
  max-width: 80px;
}

.mobile-nav-item:hover,
.mobile-nav-item:active {
  color: var(--primary);
  background: rgba(37, 99, 235, 0.05);
}

.mobile-nav-icon {
  font-size: 20px;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ===== CONTAINER & LAYOUT ===== */
.wrap {
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 20px;
  padding-bottom: 100px; /* Space for mobile nav */
}

/* ===== HEADER ===== */
.header {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  gap: 20px;
  position: relative;
  overflow: hidden;
}

.header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--bg-gradient-alt);
}

.logo {
  height: 64px;
  width: auto;
  border-radius: var(--radius);
  object-fit: contain;
  box-shadow: var(--shadow-sm);
}

.title {
  flex: 1;
}

.title .name {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
  letter-spacing: -0.02em;
}

.title .sub {
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
}

/* ===== NAVIGATION ===== */
.nav {
  display: flex;
  gap: 12px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}

.nav a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 14px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.nav a:hover {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.nav a:active {
  transform: translateY(0);
}

/* ===== HEADINGS ===== */
h1 {
  font-size: 32px;
  font-weight: 800;
  margin: 32px 0 20px;
  color: var(--text-primary);
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 12px;
}

h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 16px;
  color: var(--text-primary);
  letter-spacing: -0.02em;
}

h3 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
  color: var(--text-primary);
}

/* ===== CARDS ===== */
.card {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  margin-bottom: 20px;
}

.card:hover {
  box-shadow: var(--shadow-lg);
}

/* ===== GRID LAYOUTS ===== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 24px;
  margin-bottom: 28px;
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

/* ===== FORMS ===== */
label {
  display: block;
  margin-bottom: 20px;
  font-weight: 600;
  color: var(--text-primary);
  font-size: 14px;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="month"],
input[type="file"],
select,
textarea {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--border);
  background: var(--bg-secondary);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary);
  transition: var(--transition-fast);
  margin-top: 6px;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="number"]:focus,
input[type="month"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

input[type="file"] {
  padding: 10px;
  cursor: pointer;
}

input[type="file"]::file-selector-button {
  padding: 8px 16px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: var(--radius-sm);
  font-weight: 600;
  cursor: pointer;
  margin-right: 12px;
  transition: var(--transition-fast);
}

input[type="file"]::file-selector-button:hover {
  background: var(--primary-dark);
}

textarea {
  resize: vertical;
  min-height: 80px;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary);
}

/* ===== BUTTONS ===== */
button,
.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-md);
}

button:hover,
.btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

button:active,
.btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.btn-secondary {
  background: var(--secondary);
  color: white;
}

.btn-secondary:hover {
  background: var(--secondary-dark);
}

.btn-danger {
  background: var(--danger);
  color: white;
}

.btn-danger:hover {
  background: var(--danger-dark);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  background: var(--success-dark);
}

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary);
  color: white;
}

.btn-link {
  background: none;
  color: var(--primary);
  padding: 0;
  box-shadow: none;
  text-decoration: underline;
  font-weight: 600;
}

.btn-link:hover {
  color: var(--primary-dark);
  transform: none;
  box-shadow: none;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

.btn-lg {
  padding: 16px 32px;
  font-size: 16px;
}

/* ===== TABLES ===== */
table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 16px;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

thead {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

th {
  padding: 16px 14px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: white;
  border: none;
}

th[data-sort],
th[onclick] {
  cursor: pointer;
  user-select: none;
  transition: var(--transition-fast);
}

th[data-sort]:hover,
th[onclick]:hover {
  background: rgba(255, 255, 255, 0.1);
}

.sort-indicator {
  display: inline-block;
  margin-left: 6px;
  opacity: 0.7;
}

td {
  padding: 14px;
  border-bottom: 1px solid var(--border);
  color: var(--text-primary);
  vertical-align: middle;
}

tbody tr {
  transition: var(--transition-fast);
}

tbody tr:hover {
  background: rgba(37, 99, 235, 0.03);
}

tbody tr:last-child td {
  border-bottom: none;
}

tfoot {
  background: var(--bg-primary);
  font-weight: 700;
}

tfoot td {
  padding: 16px 14px;
  border-top: 2px solid var(--border);
  border-bottom: none;
}

/* ===== ACCORDION ===== */
.accordion-item {
  background: var(--bg-secondary);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 16px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.accordion-item:hover {
  box-shadow: var(--shadow-md);
}

.accordion-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px;
  cursor: pointer;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
  transition: var(--transition-fast);
}

.accordion-head:hover {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
}

.accordion-head h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.accordion-head h3 a {
  color: inherit;
  text-decoration: none;
}

.accordion-body {
  display: none;
  padding: 24px;
  background: var(--bg-secondary);
}

.actions {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

/* ===== PILLS & BADGES ===== */
.pill {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.pill-success {
  background: rgba(16, 185, 129, 0.1);
  color: var(--success);
}

.pill-danger {
  background: rgba(239, 68, 68, 0.1);
  color: var(--danger);
}

.pill-warning {
  background: rgba(245, 158, 11, 0.1);
  color: var(--warning);
}

/* ===== NOTICES & ALERTS ===== */
.notice {
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin: 16px 0;
  border-left: 4px solid;
  background: var(--bg-secondary);
  font-weight: 500;
  box-shadow: var(--shadow-sm);
}

.notice {
  border-color: var(--info);
  background: rgba(59, 130, 246, 0.05);
  color: var(--info-dark);
}

.notice-success {
  border-color: var(--success);
  background: rgba(16, 185, 129, 0.05);
  color: var(--success-dark);
}

.notice-warning {
  border-color: var(--warning);
  background: rgba(245, 158, 11, 0.05);
  color: var(--warning-dark);
}

.notice-danger,
.error-notice {
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.05);
  color: var(--danger-dark);
}

/* ===== UTILITY CLASSES ===== */
.muted {
  color: var(--text-muted);
  font-size: 14px;
}

.text-secondary {
  color: var(--text-secondary);
}

.right {
  text-align: right;
}

.center {
  text-align: center;
}

small,
.small {
  font-size: 13px;
  color: var(--text-muted);
}

.help {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 400;
}

.bar {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 16px 0;
  flex-wrap: wrap;
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 16px 0;
  gap: 16px;
  flex-wrap: wrap;
}

/* ===== SEARCH INPUT ===== */
input.search,
#searchCouriers,
#searchCouriersEdit {
  max-width: 320px;
  padding: 10px 16px;
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 14px;
  transition: var(--transition-fast);
}

input.search:focus,
#searchCouriers:focus,
#searchCouriersEdit:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ===== LOADING STATES ===== */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: white;
  animation: spin 0.8s linear infinite;
}

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

/* ===== RESPONSIVE STYLES ===== */

/* Tablet and below */
@media (max-width: 1024px) {
  .wrap {
    padding: 20px 16px;
    padding-bottom: 100px;
  }
  
  .grid {
    grid-template-columns: 1fr;
  }
  
  h1 {
    font-size: 28px;
  }
  
  .card {
    padding: 20px;
  }
}

/* Mobile */
@media (max-width: 768px) {
  body {
    padding-bottom: 70px;
  }
  
  .wrap {
    padding: 16px 12px;
    padding-bottom: 90px;
  }
  
  /* Show mobile navigation */
  .mobile-nav {
    display: block;
  }
  
  /* Hide desktop navigation */
  .nav {
    display: none;
  }
  
  .header {
    flex-direction: column;
    text-align: center;
    padding: 16px;
    gap: 12px;
  }
  
  .logo {
    height: 48px;
  }
  
  .title .name {
    font-size: 20px;
  }
  
  .title .sub {
    font-size: 13px;
  }
  
  h1 {
    font-size: 24px;
    margin: 20px 0 16px;
  }
  
  h2 {
    font-size: 18px;
  }
  
  .card {
    padding: 16px;
    border-radius: var(--radius-md);
  }
  
  .grid {
    gap: 16px;
  }
  
  table {
    font-size: 13px;
  }
  
  th,
  td {
    padding: 10px 8px;
  }
  
  /* Make tables scrollable on mobile */
  .table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 -16px;
    padding: 0 16px;
  }
  
  .accordion-head {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
  
  .accordion-head h3 {
    font-size: 16px;
  }
  
  .actions {
    width: 100%;
    justify-content: flex-start;
  }
  
  button,
  .btn {
    font-size: 13px;
    padding: 10px 16px;
  }
  
  .btn-sm {
    padding: 6px 12px;
    font-size: 12px;
  }
  
  .top {
    flex-direction: column;
    align-items: stretch;
  }
  
  input.search,
  #searchCouriers,
  #searchCouriersEdit {
    max-width: 100%;
    width: 100%;
  }
  
  label {
    font-size: 13px;
  }
  
  input[type="text"],
  input[type="email"],
  input[type="number"],
  input[type="month"],
  select,
  textarea {
    font-size: 16px; /* Prevents zoom on iOS */
  }
}

/* Small mobile devices */
@media (max-width: 480px) {
  .wrap {
    padding: 12px 8px;
    padding-bottom: 90px;
  }
  
  .header {
    padding: 12px;
  }
  
  .card {
    padding: 12px;
  }
  
  h1 {
    font-size: 20px;
  }
  
  .mobile-nav-item {
    font-size: 10px;
    padding: 6px 8px;
  }
  
  .mobile-nav-icon {
    font-size: 18px;
    width: 20px;
    height: 20px;
  }
  
  th,
  td {
    padding: 8px 6px;
    font-size: 12px;
  }
  
  .pill {
    font-size: 11px;
    padding: 4px 10px;
  }
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card,
.accordion-item {
  animation: fadeIn 0.3s ease-out;
}

/* ===== PRINT STYLES ===== */
@media print {
  .mobile-nav,
  .nav,
  button,
  .btn,
  .actions {
    display: none !important;
  }
  
  .wrap {
    max-width: 100%;
    padding: 0;
  }
  
  .card {
    box-shadow: none;
    page-break-inside: avoid;
  }
}

/* ===== SCROLLBAR STYLING (Webkit browsers) ===== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
  background: var(--gray-lighter);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gray-light);
}

/* ===== FOCUS VISIBLE (Accessibility) ===== */
*:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ===== SELECTION ===== */
::selection {
  background: rgba(37, 99, 235, 0.2);
  color: var(--text-primary);
}




