/* =========================================================
   NSG SUPPORT - DESIGN SYSTEM & MODERN UI STYLES
   Style: Modern – Professional – Technology – Clean – Education
   ========================================================= */

:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-dark: #1e40af;
  --primary-light: #eff6ff;
  --navy: #0f172a;
  --navy-surface: #1e293b;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --bg-main: #f8fafc;
  --card-bg: #ffffff;
  --border-color: #e2e8f0;

  /* Urgency Colors */
  --urgent-red: #ef4444;
  --urgent-red-bg: #fef2f2;
  --urgent-red-border: #fecaca;

  --high-orange: #f97316;
  --high-orange-bg: #fff7ed;
  --high-orange-border: #fed7aa;

  --med-yellow: #eab308;
  --med-yellow-bg: #fefce8;
  --med-yellow-border: #fef08a;

  --normal-blue: #3b82f6;
  --normal-blue-bg: #eff6ff;
  --normal-blue-border: #bfdbfe;

  --done-green: #10b981;
  --done-green-bg: #ecfdf5;
  --done-green-border: #a7f3d0;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  background-color: var(--bg-main);
  color: var(--text-main);
  margin: 0;
  padding: 0;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* Fix iOS Safari auto-zoom on input focus */
@media screen and (-webkit-min-device-pixel-ratio: 0) {
  select:focus,
  textarea:focus,
  input:focus {
    font-size: 16px !important;
  }
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Card Styling */
.nsg-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px -1px rgba(0, 0, 0, 0.05);
  transition: all 0.2s ease-in-out;
}
.nsg-card:hover {
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
}

/* Priority Badges */
.badge-urgent {
  background-color: var(--urgent-red-bg);
  color: var(--urgent-red);
  border: 1px solid var(--urgent-red-border);
}
.badge-high {
  background-color: var(--high-orange-bg);
  color: var(--high-orange);
  border: 1px solid var(--high-orange-border);
}
.badge-medium {
  background-color: var(--med-yellow-bg);
  color: #a16207;
  border: 1px solid var(--med-yellow-border);
}
.badge-normal {
  background-color: var(--normal-blue-bg);
  color: var(--primary);
  border: 1px solid var(--normal-blue-border);
}
.badge-completed {
  background-color: var(--done-green-bg);
  color: var(--done-green);
  border: 1px solid var(--done-green-border);
}

/* Pulse badge for Emergency */
@keyframes pulse-red {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.85; transform: scale(1.05); }
}
.pulse-emergency {
  animation: pulse-red 2s infinite ease-in-out;
}

/* Interactive Timeline Stepper */
.timeline-step {
  position: relative;
  display: flex;
  align-items: flex-start;
  padding-bottom: 24px;
}
.timeline-step:last-child {
  padding-bottom: 0;
}
.timeline-step::before {
  content: '';
  position: absolute;
  left: 15px;
  top: 32px;
  bottom: 0;
  width: 2px;
  background-color: #e2e8f0;
}
.timeline-step:last-child::before {
  display: none;
}
.timeline-step.completed::before {
  background-color: #10b981;
}
.timeline-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  z-index: 1;
  flex-shrink: 0;
}

/* Toast Notifications */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: 380px;
  pointer-events: none;
}
.toast-item {
  pointer-events: auto;
  padding: 12px 16px;
  border-radius: 8px;
  background: #ffffff;
  color: #1e293b;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: center;
  gap: 12px;
  border-left: 4px solid var(--primary);
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  font-size: 14px;
}
.toast-item.success { border-left-color: #10b981; }
.toast-item.error { border-left-color: #ef4444; }
.toast-item.warning { border-left-color: #f59e0b; }
.toast-item.info { border-left-color: #3b82f6; }

@keyframes slideInRight {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* Star Rating */
.star-rating i {
  cursor: pointer;
  color: #cbd5e1;
  transition: color 0.15s;
}
.star-rating i.active,
.star-rating i:hover,
.star-rating i:hover ~ i {
  color: #f59e0b;
}

/* Shimmer Loading Effect */
.shimmer {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Print Styling */
@media print {
  body { background: #ffffff !important; }
  header, sidebar, nav, #toast-container, .no-print { display: none !important; }
  main { margin: 0 !important; padding: 0 !important; width: 100% !important; }
}
