/**
 * PhotoSoul Studio Order Management System
 * Custom Design System & Modern Admin Theme
 */

:root {
  --ps-primary: #3b82f6;
  --ps-primary-hover: #2563eb;
  --ps-primary-subtle: #eff6ff;
  --ps-dark: #0f172a;
  --ps-slate: #1e293b;
  --ps-muted: #64748b;
  --ps-border: #e2e8f0;
  --ps-bg: #f8fafc;
  --ps-card-bg: #ffffff;
  --ps-radius: 12px;
  --ps-radius-sm: 8px;
  --ps-radius-lg: 16px;
  --ps-shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.05);
  --ps-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);
  --ps-shadow-lg: 0 10px 25px -5px rgba(15, 23, 42, 0.08);
  --ps-whatsapp: #25D366;
  --ps-whatsapp-dark: #128C7E;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background-color: var(--ps-bg);
  color: #334155;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Typography & Headings */
h1, h2, h3, h4, h5, h6 {
  color: var(--ps-slate);
  font-weight: 600;
  letter-spacing: -0.015em;
}

/* Navbar */
.ps-navbar {
  background-color: #ffffff;
  border-bottom: 1px solid var(--ps-border);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.03);
  padding: 0.65rem 1rem;
}

.ps-brand {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--ps-dark);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.ps-brand-badge {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  background: var(--ps-primary-subtle);
  color: var(--ps-primary);
}

.nav-link {
  font-size: 0.925rem;
  font-weight: 500;
  color: #475569;
  padding: 0.5rem 0.85rem !important;
  border-radius: var(--ps-radius-sm);
  transition: all 0.15s ease-in-out;
}

.nav-link:hover {
  color: var(--ps-primary);
  background-color: #f1f5f9;
}

.nav-link.active {
  color: var(--ps-primary) !important;
  background-color: var(--ps-primary-subtle) !important;
  font-weight: 600;
}

/* Modern Cards */
.card {
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius);
  background-color: var(--ps-card-bg);
  box-shadow: var(--ps-shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.card-header {
  background-color: #ffffff;
  border-bottom: 1px solid var(--ps-border);
  font-weight: 600;
  padding: 1rem 1.25rem;
  border-top-left-radius: var(--ps-radius) !important;
  border-top-right-radius: var(--ps-radius) !important;
}

/* Metric / Stat Cards on Dashboard */
.stat-card {
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius);
  padding: 1.25rem;
  background: #ffffff;
  box-shadow: var(--ps-shadow-sm);
  position: relative;
  overflow: hidden;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

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

.stat-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.stat-value {
  font-size: 2rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--ps-slate);
}

.stat-label {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--ps-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 0.25rem;
}

/* Custom Status Badges */
.badge {
  font-weight: 600;
  padding: 0.4em 0.75em;
  border-radius: 30px;
  font-size: 0.78rem;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
}

.badge-overdue {
  background-color: #fee2e2;
  color: #991b1b;
  border: 1px solid #fca5a5;
  animation: pulse-border 2s infinite ease-in-out;
}

.badge-confirmed {
  background-color: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.badge-processing {
  background-color: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.badge-ready {
  background-color: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.badge-completed {
  background-color: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.badge-cancelled {
  background-color: #f3f4f6;
  color: #6b7280;
  border: 1px solid #e5e7eb;
  text-decoration: line-through;
}

.badge-paid {
  background-color: #d1fae5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

.badge-partially-paid {
  background-color: #ffedd5;
  color: #9a3412;
  border: 1px solid #fed7aa;
}

.badge-unpaid {
  background-color: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.badge-pickup {
  background-color: #f8fafc;
  color: #334155;
  border: 1px solid #cbd5e1;
}

.badge-courier {
  background-color: #ede9fe;
  color: #5b21b6;
  border: 1px solid #ddd6fe;
}

.badge-source-whatsapp {
  background-color: #dcfce7;
  color: #166534;
  border: 1px solid #bbf7d0;
}

.badge-source-website {
  background-color: #e0f2fe;
  color: #075985;
  border: 1px solid #bae6fd;
}

.badge-source-facebook {
  background-color: #dbeafe;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.badge-source-walkin {
  background-color: #fef9c3;
  color: #854d0e;
  border: 1px solid #fef08a;
}

/* WhatsApp Buttons */
.btn-whatsapp {
  background-color: #25D366;
  color: #ffffff;
  border: none;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  transition: all 0.15s ease;
}

.btn-whatsapp:hover {
  background-color: #20ba5a;
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(37, 211, 102, 0.35);
}

.btn-whatsapp-outline {
  color: #128C7E;
  background-color: #f0fdf4;
  border: 1px solid #86efac;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.btn-whatsapp-outline:hover {
  background-color: #25D366;
  color: #ffffff;
  border-color: #25D366;
}

/* Table Enhancements */
.table-responsive {
  border-radius: var(--ps-radius);
}

.table {
  margin-bottom: 0;
  vertical-align: middle;
}

.table th {
  background-color: #f8fafc;
  color: #64748b;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--ps-border);
  white-space: nowrap;
}

.table td {
  padding: 0.85rem 1rem;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.88rem;
}

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

/* Forms & Inputs */
.form-control, .form-select {
  border: 1px solid #cbd5e1;
  border-radius: var(--ps-radius-sm);
  padding: 0.55rem 0.85rem;
  font-size: 0.925rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus, .form-select:focus {
  border-color: var(--ps-primary);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.form-label {
  font-weight: 600;
  font-size: 0.825rem;
  color: #475569;
  margin-bottom: 0.35rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

/* Order Totals Summary Card */
.order-summary-box {
  background: #f8fafc;
  border: 1px solid var(--ps-border);
  border-radius: var(--ps-radius);
  padding: 1.25rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  font-size: 0.925rem;
}

.summary-row.total-row {
  border-top: 2px dashed #cbd5e1;
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--ps-slate);
}

.summary-row.balance-row {
  font-size: 1.1rem;
  font-weight: 700;
  padding-top: 0.5rem;
  border-top: 1px solid #e2e8f0;
}

/* Status Timeline History */
.status-timeline {
  position: relative;
  padding-left: 1.75rem;
}

.status-timeline::before {
  content: '';
  position: absolute;
  top: 5px;
  bottom: 5px;
  left: 8px;
  width: 2px;
  background-color: #e2e8f0;
}

.timeline-item {
  position: relative;
  margin-bottom: 1.25rem;
}

.timeline-dot {
  position: absolute;
  left: -1.75rem;
  top: 4px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background-color: var(--ps-primary);
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 2px #bfdbfe;
}

.timeline-time {
  font-size: 0.75rem;
  color: var(--ps-muted);
}

.timeline-content {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ps-slate);
}

/* Animations */
@keyframes pulse-border {
  0% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  70% { box-shadow: 0 0 0 5px rgba(239, 68, 68, 0); }
  100% { box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
  .stat-card {
    padding: 1rem;
  }
  .stat-value {
    font-size: 1.6rem;
  }
  .table-responsive {
    font-size: 0.825rem;
  }
  .btn-sm-responsive {
    padding: 0.3rem 0.5rem;
    font-size: 0.75rem;
  }
}

/* Print Styling */
@media print {
  .no-print, .ps-navbar, footer, .btn {
    display: none !important;
  }
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .card {
    border: none !important;
    box-shadow: none !important;
  }
}
