/* ============================================
   PARCEL TRACKING SYSTEM - MAIN STYLESHEET
   ============================================ */

/* CSS Variables */
:root {
  --primary: #1e3a5f;
  --primary-light: #2d5a8a;
  --primary-dark: #0f1f33;
  --secondary: #f59e0b;
  --secondary-light: #fbbf24;
  --accent: #10b981;
  --danger: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;
  --success: #10b981;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --white: #ffffff;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --radius: 8px;
  --radius-lg: 12px;
  --transition: all 0.2s ease-in-out;
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', 'Oxygen', 'Ubuntu', sans-serif;
  background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
  color: var(--gray-800);
  line-height: 1.6;
  min-height: 100vh;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--primary);
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 1rem;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.25rem; }

p { margin-bottom: 1rem; color: var(--gray-600); }

a {
  color: var(--primary-light);
  text-decoration: none;
  transition: var(--transition);
}

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

/* Layout Components */
.page-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* Header */
header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: var(--white);
  padding: 2rem 1.5rem;
  text-align: center;
  box-shadow: var(--shadow-md);
  position: relative;
  overflow: hidden;
}

header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  opacity: 0.5;
}

header h1 {
  color: var(--white);
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
}

header p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.1rem;
  position: relative;
  z-index: 1;
}

header .logo-icon {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  display: block;
}

/* Main Content */
main {
  flex: 1;
  padding: 3rem 1.5rem;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* Cards */
.card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 2rem;
  margin-bottom: 1.5rem;
  transition: var(--transition);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card-header {
  border-bottom: 2px solid var(--gray-100);
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
}

.card-title {
  margin-bottom: 0.25rem;
}

/* Buttons */
.button, button, input[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

.button:hover, button:hover, input[type="submit"]:hover {
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--primary) 100%);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--white);
}

.button-secondary {
  background: linear-gradient(135deg, var(--secondary) 0%, var(--secondary-light) 100%);
  color: var(--gray-900);
}

.button-secondary:hover {
  background: linear-gradient(135deg, var(--secondary-light) 0%, var(--secondary) 100%);
  color: var(--gray-900);
}

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

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

.button-danger {
  background: linear-gradient(135deg, var(--danger) 0%, #dc2626 100%);
}

.button-danger:hover {
  background: linear-gradient(135deg, #dc2626 0%, var(--danger) 100%);
}

.button-small {
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
}

.button-group {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
}

/* Forms */
form {
  width: 100%;
}

.form-group {
  margin-bottom: 1.25rem;
}

label {
  display: block;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="datetime-local"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  color: var(--gray-800);
  background: var(--white);
  border: 2px solid var(--gray-200);
  border-radius: var(--radius);
  transition: var(--transition);
  font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.1);
}

input::placeholder,
textarea::placeholder {
  color: var(--gray-400);
}

select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
  padding-right: 2.5rem;
}

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

/* Tables */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  background: var(--white);
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
}

thead {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
}

th {
  padding: 1rem 1.25rem;
  text-align: left;
  font-weight: 600;
  color: var(--white);
  font-size: 0.875rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--gray-100);
  color: var(--gray-700);
  vertical-align: middle;
}

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

tbody tr:hover {
  background-color: var(--gray-50);
}

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

/* Status Badges */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.75rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 9999px;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.status-pending {
  background: rgba(245, 158, 11, 0.1);
  color: #b45309;
}

.status-in-transit {
  background: rgba(59, 130, 246, 0.1);
  color: #1d4ed8;
}

.status-out-for-delivery {
  background: rgba(168, 85, 247, 0.1);
  color: #7c3aed;
}

.status-delivered {
  background: rgba(16, 185, 129, 0.1);
  color: #059669;
}

/* Navigation */
nav, .nav-links {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}

nav a, .nav-links a {
  padding: 0.5rem 1rem;
  color: var(--primary);
  font-weight: 500;
  border-radius: var(--radius);
  transition: var(--transition);
}

nav a:hover, .nav-links a:hover {
  background: var(--gray-100);
  text-decoration: none;
}

/* Info Cards */
.info-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  border-left: 4px solid var(--primary);
}

.info-card h3 {
  font-size: 1.125rem;
  margin-bottom: 1rem;
  color: var(--primary);
}

.info-row {
  display: flex;
  justify-content: space-between;
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--gray-100);
}

.info-row:last-child {
  border-bottom: none;
}

.info-label {
  font-weight: 600;
  color: var(--gray-600);
}

.info-value {
  color: var(--gray-800);
}

/* Messages & Alerts */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.alert-success {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid var(--success);
  color: #065f46;
}

.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid var(--danger);
  color: #991b1b;
}

.alert-warning {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid var(--warning);
  color: #92400e;
}

.alert-info {
  background: rgba(59, 130, 246, 0.1);
  border: 1px solid var(--info);
  color: #1e40af;
}

/* Footer */
footer {
  background: linear-gradient(135deg, var(--gray-800) 0%, var(--gray-900) 100%);
  color: var(--gray-300);
  padding: 2.5rem 1.5rem;
  margin-top: auto;
  text-align: center;
}

footer p {
  color: var(--gray-400);
  margin-bottom: 1rem;
}

footer ul {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
}

footer li {
  color: var(--gray-300);
  font-weight: 500;
}

/* Page-specific Styles */

/* Home/Index Page */
.hero-section {
  text-align: center;
  padding: 3rem 0;
}

.hero-section h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.hero-section p {
  font-size: 1.125rem;
  max-width: 600px;
  margin: 0 auto 2rem;
}

/* Auth Pages (Login/Register) */
.auth-container {
  max-width: 420px;
  margin: 2rem auto;
}

.auth-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
}

.auth-card h2 {
  text-align: center;
  margin-bottom: 2rem;
  font-size: 1.75rem;
}

.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--gray-100);
}

/* Dashboard */
.dashboard-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 2rem;
}

.dashboard-header h1 {
  margin-bottom: 0;
}

.dashboard-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

/* Action Forms in Tables */
.table-actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  flex-wrap: wrap;
}

.table-actions form {
  display: inline-flex;
}

.table-actions select {
  width: auto;
  min-width: 140px;
}

.table-actions button {
  padding: 0.5rem 0.75rem;
  font-size: 0.8rem;
}

/* Contact Page */
.contact-container {
  max-width: 600px;
  margin: 0 auto;
}

/* History Page */
.history-header {
  background: linear-gradient(135deg, var(--gray-50) 0%, var(--white) 100%);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
  border: 1px solid var(--gray-200);
}

/* Error Page */
.error-container {
  text-align: center;
  padding: 4rem 2rem;
}

.error-container h2 {
  font-size: 3rem;
  color: var(--danger);
  margin-bottom: 1rem;
}

.error-container p {
  font-size: 1.25rem;
  margin-bottom: 2rem;
}

/* Parcel Info Card */
.parcel-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.parcel-card-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  color: var(--white);
  padding: 1.25rem 1.5rem;
}

.parcel-card-header h3 {
  color: var(--white);
  margin-bottom: 0;
}

.parcel-card-body {
  padding: 1.5rem;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }

/* Responsive */
@media (max-width: 768px) {
  header {
    padding: 1.5rem 1rem;
  }
  
  header h1 {
    font-size: 1.75rem;
  }
  
  main {
    padding: 2rem 1rem;
  }
  
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }
  
  .button-group {
    flex-direction: column;
    align-items: stretch;
  }
  
  .dashboard-header {
    flex-direction: column;
    align-items: stretch;
  }
  
  table {
    font-size: 0.875rem;
  }
  
  th, td {
    padding: 0.75rem;
  }
  
  .table-actions {
    flex-direction: column;
  }
  
  .table-actions select {
    width: 100%;
  }
  
  footer ul {
    flex-direction: column;
    gap: 0.5rem;
  }
}

@media (max-width: 480px) {
  .auth-card {
    padding: 1.5rem;
  }
  
  .card {
    padding: 1.25rem;
  }
}

/* Icons (using box-drawing and symbols) */
.icon-package::before { content: '📦 '; }
.icon-truck::before { content: '🚚 '; }
.icon-check::before { content: '✓ '; }
.icon-user::before { content: '👤 '; }
.icon-mail::before { content: '✉ '; }
.icon-search::before { content: '🔍 '; }

.input-readonly {
    background-color: #e9ecef;   /* light grey like Bootstrap */
    color: #6c757d;              /* faded text */
    cursor: not-allowed;
    opacity: 0.9;
}
