/* ==========================================================================
   LOCAL JOB PORTAL — UNIFIED PREMIUM SAAS DESIGN SYSTEM
   Professional Employment & Local Business Network Platform
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Design Tokens & Root Variables
   -------------------------------------------------------------------------- */
:root {
  /* Brand Primary Palette (Deep Slate Navy & Modern Indigo-Blue) */
  --brand-navy-950: #020617;
  --brand-navy-900: #0f172a;
  --brand-navy-850: #151f32;
  --brand-navy-800: #1e293b;
  --brand-navy-700: #334155;
  --brand-navy-600: #475569;
  
  /* Brand Accent & Action (Vibrant Electric Blue & Cyan) */
  --brand-blue-50:  #eff6ff;
  --brand-blue-100: #dbeafe;
  --brand-blue-200: #bfdbfe;
  --brand-blue-500: #3b82f6;
  --brand-blue-600: #2563eb;
  --brand-blue-700: #1d4ed8;
  --brand-blue-800: #1e40af;
  --brand-cyan-400: #22d3ee;
  --brand-cyan-500: #06b6d4;
  --brand-indigo-600: #4f46e5;
  
  /* Semantic Status Colors */
  --color-success: #10b981;
  --color-success-bg: #ecfdf5;
  --color-success-border: #a7f3d0;
  --color-warning: #f59e0b;
  --color-warning-bg: #fffbeb;
  --color-warning-border: #fde68a;
  --color-danger: #ef4444;
  --color-danger-bg: #fef2f2;
  --color-danger-border: #fecaca;
  --color-info: #0284c7;
  --color-info-bg: #f0f9ff;
  --color-info-border: #bae6fd;
  --color-purple: #7c3aed;
  --color-purple-bg: #f5f3ff;
  --color-purple-border: #ddd6fe;
  
  /* Neutral Surfaces */
  --surface-base: #f8fafc;
  --surface-card: #ffffff;
  --surface-card-subtle: #f8fafc;
  --surface-border: #e2e8f0;
  --surface-border-subtle: #f1f5f9;
  --surface-border-strong: #cbd5e1;
  
  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Plus Jakarta Sans', 'Inter', -apple-system, sans-serif;
  
  /* Radius Scale */
  --radius-xs: 0.25rem;  /* 4px */
  --radius-sm: 0.375rem; /* 6px */
  --radius-md: 0.5rem;   /* 8px */
  --radius-lg: 0.75rem;  /* 12px */
  --radius-xl: 1rem;     /* 16px */
  --radius-2xl: 1.25rem; /* 20px */
  --radius-3xl: 1.5rem;  /* 24px */
  --radius-full: 9999px;
  
  /* Shadows */
  --shadow-subtle: 0 1px 2px 0 rgba(15, 23, 42, 0.04);
  --shadow-card: 0 1px 3px 0 rgba(15, 23, 42, 0.05), 0 1px 2px -1px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.06), 0 2px 4px -2px rgba(15, 23, 42, 0.04);
  --shadow-hover: 0 10px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
  --shadow-elevated: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.05);
  --shadow-modal: 0 25px 50px -12px rgba(15, 23, 42, 0.25);
  
  /* Mobile Layout Constants */
  --mobile-header-height: 3.75rem; /* 60px */
  --mobile-bottom-nav-height: 4rem; /* 64px */
}

/* --------------------------------------------------------------------------
   2. Base & Typography Resets
   -------------------------------------------------------------------------- */
html {
  font-family: var(--font-sans);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scroll-behavior: smooth;
  touch-action: manipulation;
}

body {
  background-color: var(--surface-base);
  color: var(--brand-navy-900);
  overflow-x: hidden;
  min-height: 100vh;
}

.font-display {
  font-family: var(--font-display);
}

/* Touch-friendly target sizing for mobile accessibility */
button, 
a, 
input, 
select, 
textarea {
  touch-action: manipulation;
}

/* Prevent unwanted zoom on iOS devices for inputs under 16px */
@media screen and (max-width: 768px) {
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="tel"],
  input[type="url"],
  input[type="date"],
  select,
  textarea {
    font-size: 16px !important;
  }
}

/* Modern clean scrollbars */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 9999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Accessible focus ring */
:focus-visible {
  outline: 2px solid var(--brand-blue-600);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   3. Unified Button Component System
   -------------------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-weight: 600;
  border-radius: var(--radius-xl);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
  border: 1px solid transparent;
  text-decoration: none;
  font-family: inherit;
  line-height: 1.25;
}

.btn:active {
  transform: scale(0.98);
}

.btn:disabled,
.btn[aria-disabled="true"] {
  opacity: 0.6;
  cursor: not-allowed;
  pointer-events: none;
  transform: none;
}

/* Button Sizes */
.btn-xs {
  padding: 0.375rem 0.625rem;
  font-size: 0.75rem;
  line-height: 1rem;
  border-radius: var(--radius-md);
}

.btn-sm {
  padding: 0.5rem 0.875rem;
  font-size: 0.8125rem;
  line-height: 1.125rem;
  border-radius: var(--radius-lg);
}

.btn-md {
  padding: 0.625rem 1.25rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.btn-lg {
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  line-height: 1.5rem;
  border-radius: var(--radius-2xl);
}

/* Button Variants */
.btn-primary {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.3);
  transform: translateY(-1px);
}

.btn-secondary {
  background-color: #ffffff;
  color: var(--brand-navy-800);
  border-color: #e2e8f0;
  box-shadow: var(--shadow-subtle);
}
.btn-secondary:hover {
  background-color: #f8fafc;
  border-color: #cbd5e1;
  color: var(--brand-navy-950);
}

.btn-dark {
  background-color: var(--brand-navy-900);
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}
.btn-dark:hover {
  background-color: var(--brand-navy-800);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.25);
  transform: translateY(-1px);
}

.btn-outline {
  background-color: transparent;
  color: var(--brand-navy-700);
  border-color: #cbd5e1;
}
.btn-outline:hover {
  background-color: #f8fafc;
  border-color: #94a3b8;
  color: var(--brand-navy-900);
}

.btn-ghost {
  background-color: transparent;
  color: #64748b;
}
.btn-ghost:hover {
  background-color: #f1f5f9;
  color: var(--brand-navy-900);
}

.btn-danger {
  background-color: #fef2f2;
  color: #dc2626;
  border-color: #fecaca;
}
.btn-danger:hover {
  background-color: #fee2e2;
  color: #b91c1c;
}

.btn-danger-solid {
  background-color: #dc2626;
  color: #ffffff;
  box-shadow: 0 4px 12px rgba(220, 38, 38, 0.2);
}
.btn-danger-solid:hover {
  background-color: #b91c1c;
  box-shadow: 0 6px 16px rgba(220, 38, 38, 0.3);
}

.btn-success {
  background-color: #ecfdf5;
  color: #059669;
  border-color: #a7f3d0;
}
.btn-success:hover {
  background-color: #d1fae5;
  color: #047857;
}

/* --------------------------------------------------------------------------
   4. Unified Form Controls
   -------------------------------------------------------------------------- */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #475569;
  margin-bottom: 0.375rem;
}

.form-label-required::after {
  content: ' *';
  color: #ef4444;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  color: #0f172a;
  background-color: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: var(--radius-xl);
  transition: all 0.2s ease;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  background-color: #ffffff;
  border-color: var(--brand-blue-600);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  outline: none;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: #94a3b8;
}

.form-hint {
  font-size: 0.75rem;
  color: #64748b;
  margin-top: 0.25rem;
}

.form-error {
  font-size: 0.75rem;
  font-weight: 500;
  color: #dc2626;
  margin-top: 0.25rem;
}

/* High contrast admin login inputs (Required for security testing & high-contrast gate) */
.admin-login-input {
  background-color: rgba(15, 23, 42, 0.75) !important;
  border-color: #334155 !important;
  color: #ffffff !important;
}
.admin-login-input:focus {
  border-color: #3b82f6 !important;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25) !important;
  background-color: rgba(15, 23, 42, 0.95) !important;
}
.admin-login-input::placeholder {
  color: #64748b !important;
}

/* --------------------------------------------------------------------------
   5. Reusable Cards & Layout Containers
   -------------------------------------------------------------------------- */
.saas-card {
  background-color: #ffffff;
  border-radius: var(--radius-2xl);
  border: 1px solid #e2e8f0;
  box-shadow: var(--shadow-card);
  transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.saas-card-interactive {
  transition: box-shadow 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}
.saas-card-interactive:hover {
  border-color: #cbd5e1;
  box-shadow: var(--shadow-hover);
  transform: translateY(-2px);
}

.saas-stat-card {
  background-color: #ffffff;
  border-radius: var(--radius-2xl);
  border: 1px solid #e2e8f0;
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-card);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.saas-stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: #bfdbfe;
}

/* --------------------------------------------------------------------------
   6. Badges & Status Indicators
   -------------------------------------------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: 1px solid transparent;
  line-height: 1;
}

.badge-success {
  background-color: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.badge-warning {
  background-color: #fffbeb;
  color: #b45309;
  border-color: #fde68a;
}

.badge-danger {
  background-color: #fef2f2;
  color: #b91c1c;
  border-color: #fecaca;
}

.badge-info {
  background-color: #f0f9ff;
  color: #0369a1;
  border-color: #bae6fd;
}

.badge-neutral {
  background-color: #f1f5f9;
  color: #475569;
  border-color: #e2e8f0;
}

.badge-brand {
  background-color: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.badge-purple {
  background-color: #f5f3ff;
  color: #7c3aed;
  border-color: #ddd6fe;
}

/* --------------------------------------------------------------------------
   7. Tables & Responsive Cards
   -------------------------------------------------------------------------- */
.saas-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
  text-align: left;
}

.saas-table thead th {
  background-color: #f8fafc;
  color: #475569;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid #e2e8f0;
}

.saas-table tbody td {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid #f1f5f9;
  vertical-align: middle;
}

.saas-table tbody tr:hover {
  background-color: rgba(248, 250, 252, 0.8);
}

/* Responsive Table to Cards Pattern for Mobile */
@media (max-width: 767px) {
  .table-cards-mobile thead {
    display: none;
  }
  .table-cards-mobile tbody,
  .table-cards-mobile tr,
  .table-cards-mobile td {
    display: block;
    width: 100%;
  }
  .table-cards-mobile tr {
    margin-bottom: 1rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: var(--radius-xl);
    padding: 1rem;
    box-shadow: var(--shadow-subtle);
  }
  .table-cards-mobile td {
    padding: 0.5rem 0;
    border-bottom: 1px dashed #f1f5f9;
  }
  .table-cards-mobile td:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }
}

/* --------------------------------------------------------------------------
   8. Empty States & Feedback Widgets
   -------------------------------------------------------------------------- */
.empty-state-box {
  padding: 3rem 1.5rem;
  text-align: center;
  border-radius: var(--radius-2xl);
  background-color: #ffffff;
  border: 1px dashed #cbd5e1;
}

.empty-state-icon {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 9999px;
  background-color: #f1f5f9;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

.empty-state-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.375rem;
}

.empty-state-desc {
  font-size: 0.8125rem;
  color: #64748b;
  max-w: 24rem;
  margin: 0 auto 1.25rem;
  line-height: 1.5;
}

/* --------------------------------------------------------------------------
   9. Mobile Navigation Architecture
   -------------------------------------------------------------------------- */
.mobile-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--mobile-bottom-nav-height);
  background-color: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid rgba(226, 232, 240, 0.8);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: center;
  z-index: 40;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  box-shadow: 0 -4px 12px rgba(15, 23, 42, 0.04);
}

@media (min-width: 1024px) {
  .mobile-bottom-nav {
    display: none !important;
  }
}

.mobile-bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: #64748b;
  text-decoration: none;
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 0.25rem;
  gap: 0.25rem;
  transition: color 0.15s ease;
  position: relative;
}

.mobile-bottom-nav-item.active {
  color: var(--brand-blue-600);
}

.mobile-bottom-nav-item.active svg {
  color: var(--brand-blue-600);
  transform: scale(1.08);
}

/* Slide-out mobile drawer */
.drawer-backdrop {
  background-color: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: opacity 0.3s ease;
}

.drawer-panel {
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.drawer-open .drawer-panel {
  transform: translateX(0);
}

@media (max-width: 1023px) {
  .has-mobile-nav {
    padding-bottom: calc(var(--mobile-bottom-nav-height) + 1.5rem) !important;
  }
}

/* --------------------------------------------------------------------------
   10. Animations, Wall of Fame & Interactive Effects
   -------------------------------------------------------------------------- */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes pulseGlow {
  0%, 100% { opacity: 0.4; transform: scale(1); }
  50% { opacity: 0.75; transform: scale(1.08); }
}

@keyframes marqueeLeft {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

@keyframes blinkCursor {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

.animate-fade-in {
  animation: fadeIn 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-slide-down {
  animation: slideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-pulse-glow {
  animation: pulseGlow 6s ease-in-out infinite;
}

.animate-marquee-track {
  display: flex;
  width: max-content;
  animation: marqueeLeft 38s linear infinite;
  will-change: transform;
}

.animate-marquee-track:hover {
  animation-play-state: paused;
}

.marquee-fade-edges {
  mask-image: linear-gradient(to right, transparent 0%, black 4%, black 96%, transparent 100%);
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 4%, black 96%, transparent 100%);
}

.typing-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background-color: var(--brand-blue-600);
  margin-left: 2px;
  vertical-align: middle;
  animation: blinkCursor 0.8s infinite;
}

.interactive-card {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), 
              box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), 
              border-color 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.nav-item-link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, #2563eb, #06b6d4);
  border-radius: 2px;
  transition: width 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-item-link:hover::after {
  width: 100%;
}

.glass-panel {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(226, 232, 240, 0.8);
}

.glass-panel-dark {
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(51, 65, 85, 0.6);
}

.btn-shimmer {
  position: relative;
  overflow: hidden;
}

.btn-shimmer::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    60deg,
    transparent 20%,
    rgba(255, 255, 255, 0.25) 50%,
    transparent 80%
  );
  transform: translateX(-100%);
  transition: transform 0.75s ease;
}

.btn-shimmer:hover::after {
  transform: translateX(100%);
}

.skeleton {
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-md);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
