/* ===== Fonts & Import ===== */
@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;700;900&display=swap');

@font-face {
  font-family: 'YekanBakh';
  src: url('/fonts/YekanBakh-Regular.woff2') format('woff2'),
    url('/fonts/YekanBakh-Regular.woff') format('woff');
  font-style: normal;
  font-display: swap;
}

/* ===== CSS Variables (Light Theme Default) ===== */
:root {
  --bg-primary: #F8FAFC;
  --bg-secondary: #F1F5F9;
  --bg-card: #FFFFFF;
  --bg-card-hover: #F8FAFC;
  --bg-sidebar: #FFFFFF;
  --bg-glass: rgba(255, 255, 255, 0.8);
  
  --text-primary: #0F172A;
  --text-secondary: #334155;
  --text-muted: #64748B;
  --border-color: #E2E8F0;
  --border-light: rgba(0, 0, 0, 0.04);
  
  --primary: #2563EB;
  --primary-hover: #1D4ED8;
  --primary-glow: rgba(37, 99, 235, 0.1);
  --secondary: #E11D48;
  --secondary-hover: #BE123C;
  --success: #16A34A;
  --success-hover: #15803D;
  --warning: #D97706;
  --warning-hover: #B45309;
  --error: #DC2626;
  --error-hover: #B91C1C;
  
  --badge-pending-bg: rgba(217, 119, 6, 0.1);
  --badge-pending-text: #D97706;
  --badge-approved-bg: rgba(22, 163, 74, 0.1);
  --badge-approved-text: #16A34A;
  --badge-rejected-bg: rgba(220, 38, 38, 0.1);
  --badge-rejected-text: #DC2626;
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.08), 0 2px 4px -1px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 15px rgba(37, 99, 235, 0.15);
  
  --font-family: 'YekanBakh', 'Vazirmatn', 'Segoe UI', Tahoma, sans-serif;
  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s ease;
}

/* ===== Dark Theme override ===== */
[data-theme="dark"] {
  --bg-primary: #0F172A;
  --bg-secondary: #1E293B;
  --bg-card: #1E293B;
  --bg-card-hover: #334155;
  --bg-sidebar: #1E293B;
  --bg-glass: rgba(30, 41, 59, 0.85);
  
  --text-primary: #F1F5F9;
  --text-secondary: #94A3B8;
  --text-muted: #64748B;
  --border-color: #334155;
  --border-light: rgba(255, 255, 255, 0.04);
  
  --primary: #3B82F6;
  --primary-hover: #2563EB;
  --primary-glow: rgba(59, 130, 246, 0.15);
  --secondary: #FB7185;
  --secondary-hover: #FCA5A5;
  --success: #22C55E;
  --success-hover: #16A34A;
  --warning: #F59E0B;
  --warning-hover: #D97706;
  --error: #EF4444;
  --error-hover: #DC2626;
  
  --badge-pending-bg: rgba(245, 158, 11, 0.15);
  --badge-pending-text: #F59E0B;
  --badge-approved-bg: rgba(34, 197, 94, 0.15);
  --badge-approved-text: #22C55E;
  --badge-rejected-bg: rgba(239, 68, 68, 0.15);
  --badge-rejected-text: #EF4444;
  
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.3), 0 1px 2px -1px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -1px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -2px rgba(0, 0, 0, 0.4);
  --shadow-glow: 0 0 20px rgba(59, 130, 246, 0.2);
}

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

input, button, select, textarea {
  font-family: var(--font-family) !important;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  direction: rtl;
  transition: background var(--transition-normal), color var(--transition-normal);
}

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

a:hover {
  color: var(--primary-hover);
}

/* ===== Layout Wrapper ===== */
.app-container {
  display: flex;
  min-height: 100vh;
  position: relative;
}

/* ===== Right-Aligned Sidebar ===== */
.sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  border-left: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  top: 0;
  right: 0;
  z-index: 1000;
  transition: transform var(--transition-normal);
}

.sidebar-brand {
  padding: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-logo-icon {
  width: 38px;
  height: 38px;
  background: var(--primary);
  color: #fff;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
}

.sidebar-brand-title {
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--primary);
}

.sidebar-user-info {
  margin: 1rem 1rem 0.5rem 1rem;
  padding: 1rem;
  background: var(--bg-secondary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.sidebar-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary-glow);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1.1rem;
}

.sidebar-user-details {
  min-width: 0;
}

.sidebar-user-name {
  font-size: 0.9rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-phone {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.sidebar-menu {
  list-style: none;
  padding: 1rem 0.75rem;
  flex-grow: 1;
  overflow-y: auto;
}

.sidebar-menu-item {
  margin-bottom: 0.25rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition-fast);
}

.sidebar-link i, .sidebar-link .icon {
  font-size: 1.15rem;
}

.sidebar-link:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.sidebar-link.active {
  background: var(--primary);
  color: #ffffff;
}

.sidebar-footer {
  padding: 1rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* ===== Main Panel View ===== */
.main-panel {
  flex-grow: 1;
  margin-right: 260px;
  padding: 2rem;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ===== Mobile Header Bar ===== */
.mobile-topbar {
  display: none;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border-color);
  height: 60px;
  padding: 0 1.25rem;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 900;
}

.mobile-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--primary);
}

.menu-toggle-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.5rem;
  cursor: pointer;
}

/* ===== Responsive adjustments ===== */
@media (max-width: 992px) {
  .sidebar {
    transform: translateX(100%);
  }
  .sidebar.open {
    transform: translateX(0);
  }
  .main-panel {
    margin-right: 0;
    padding: 1.25rem;
  }
  .mobile-topbar {
    display: flex;
  }
  
  .sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    z-index: 999;
  }
  .sidebar-backdrop.active {
    display: block;
  }
}

/* ===== Common Design Primitives ===== */

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

/* Card */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-normal), border-color var(--transition-normal), box-shadow var(--transition-normal);
  margin-bottom: 1.5rem;
}

.card:hover {
  border-color: var(--border-light);
}

/* Grid System */
.grid-cols-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.grid-cols-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

/* Stat Card */
.stat-card {
  position: relative;
  overflow: hidden;
  padding: 1.25rem;
}

.stat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.stat-title {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 600;
}

.stat-icon-wrapper {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.stat-value {
  font-size: 1.8rem;
  font-weight: 900;
  line-height: 1;
}

/* Stats color modifiers */
.stat-primary .stat-icon-wrapper { background: rgba(37,99,235,0.1); color: var(--primary); }
.stat-warning .stat-icon-wrapper { background: rgba(245,158,11,0.1); color: var(--warning); }
.stat-success .stat-icon-wrapper { background: rgba(34,197,94,0.1); color: var(--success); }
.stat-danger .stat-icon-wrapper  { background: rgba(239,68,68,0.1); color: var(--error); }

/* Badges */
.badge-status {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  text-align: center;
}

.badge-pending { background: var(--badge-pending-bg); color: var(--badge-pending-text); }
.badge-approved { background: var(--badge-approved-bg); color: var(--badge-approved-text); }
.badge-rejected { background: var(--badge-rejected-bg); color: var(--badge-rejected-text); }

.badge-type {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-sm);
  font-size: 0.75rem;
  font-weight: bold;
}
.badge-employer { background: rgba(37,99,235,0.1); color: var(--primary); }
.badge-jobseeker { background: rgba(225,29,72,0.1); color: var(--secondary); }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all var(--transition-fast);
  gap: 0.5rem;
}

.btn-sm {
  padding: 0.35rem 0.8rem;
  font-size: 0.75rem;
}

.btn-full {
  width: 100%;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: var(--shadow-glow);
}

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

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

.btn-danger {
  background: var(--error);
  color: #fff;
}

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

.btn-outline {
  background: transparent;
  border-color: var(--border-color);
  color: var(--text-secondary);
}

.btn-outline:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-color: var(--text-muted);
}

/* ===== Tables & Containers ===== */
.table-wrapper {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  box-shadow: var(--shadow-sm);
  margin-top: 1rem;
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: right;
}

.table th, .table td {
  padding: 1rem 1.25rem;
  font-size: 0.875rem;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.table th {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-weight: 700;
}

.table tr:hover {
  background: var(--bg-card-hover);
}

/* ===== Forms ===== */
.form-group {
  margin-bottom: 1.25rem;
}

.form-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.form-group input, .form-group textarea, .form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--transition-fast);
  box-sizing: border-box;
}

.form-group input:focus, .form-group textarea:focus, .form-group select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-glow);
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0.5rem;
  background: var(--bg-secondary);
  padding: 0.4rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}

.tab-btn {
  flex-grow: 1;
  padding: 0.65rem 1.25rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  border-radius: var(--radius-md);
  font-weight: 600;
  font-size: 0.9rem;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.tab-btn:hover {
  color: var(--text-primary);
  background: rgba(0,0,0,0.02);
}

.tab-btn.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Modals */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.modal.open {
  opacity: 1;
  pointer-events: auto;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
}

.modal-content {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  width: 90%;
  max-width: 480px;
  padding: 2rem;
  box-shadow: var(--shadow-lg);
  z-index: 10;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1.5rem;
}

/* Theme Switcher Toggle */
.theme-switch-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.15rem;
  cursor: pointer;
  padding: 0.35rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition-fast);
}

.theme-switch-btn:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

/* ===== Alert UI Components ===== */
.alert {
  padding: 0.85rem 1.2rem;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.alert-success {
  background: rgba(22, 163, 74, 0.1);
  color: #16a34a;
  border: 1px solid rgba(22, 163, 74, 0.2);
}

.alert-error {
  background: rgba(220, 38, 38, 0.1);
  color: #dc2626;
  border: 1px solid rgba(220, 38, 38, 0.2);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-icon {
  font-size: 3.5rem;
  margin-bottom: 1rem;
  opacity: 0.6;
}

/* Type Toggle for submissions forms */
.form-type-toggle {
  display: flex;
  background: var(--bg-secondary);
  padding: 0.35rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  border: 1px solid var(--border-color);
}

.toggle-btn {
  flex: 1;
  padding: 0.6rem;
  background: transparent;
  border: none;
  color: var(--text-secondary);
  font-weight: bold;
  cursor: pointer;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  transition: all var(--transition-fast);
}

.toggle-btn.active {
  background: var(--bg-card);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

/* ===== Stepper Flow UI ===== */
.stepper-container {
  margin-bottom: 2rem;
}

.stepper {
  display: flex;
  justify-content: space-between;
  position: relative;
  margin-bottom: 1.5rem;
}

.stepper::before {
  content: '';
  position: absolute;
  top: 50%;
  right: 0;
  left: 0;
  height: 2px;
  background: var(--border-color);
  transform: translateY(-50%);
  z-index: 1;
}

.step {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 0.85rem;
  z-index: 2;
  transition: all var(--transition-fast);
}

.step.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-glow);
}

.step.completed {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.step-labels {
  display: flex;
  justify-content: space-between;
  padding: 0 0.2rem;
}

.step-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: bold;
  width: 70px;
  text-align: center;
}

.step-label.active {
  color: var(--primary);
}

.step-panel {
  display: none;
}

.step-panel.active {
  display: block;
}

/* ===== Support Ticketing & Chat UI ===== */
.ticket-grid {
  display: grid;
  grid-template-columns: 350px 1fr;
  gap: 1.5rem;
  height: calc(100vh - 120px);
}

@media (max-width: 992px) {
  .ticket-grid {
    grid-template-columns: 1fr;
    height: auto;
  }
}

.ticket-sidebar-list {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.ticket-list-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  font-weight: bold;
}

.ticket-items {
  overflow-y: auto;
  flex-grow: 1;
}

.ticket-item {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background var(--transition-fast);
}

.ticket-item:hover {
  background: var(--bg-secondary);
}

.ticket-item.active {
  background: var(--primary-glow);
  border-right: 3px solid var(--primary);
}

.ticket-item-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}

.ticket-item-title {
  font-size: 0.875rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-header {
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-user-title {
  font-weight: bold;
}

.chat-messages {
  flex-grow: 1;
  padding: 1.5rem;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: var(--bg-primary);
}

.chat-bubble-wrapper {
  display: flex;
  flex-direction: column;
  max-width: 75%;
}

.chat-bubble-wrapper.self {
  align-self: flex-start;
}

.chat-bubble-wrapper.other {
  align-self: flex-end;
}

.chat-bubble {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-lg);
  font-size: 0.9rem;
}

.chat-bubble-wrapper.self .chat-bubble {
  background: var(--primary);
  color: #fff;
  border-top-right-radius: 0;
}

.chat-bubble-wrapper.other .chat-bubble {
  background: var(--bg-card);
  color: var(--text-primary);
  border-top-left-radius: 0;
  border: 1px solid var(--border-color);
}

.chat-time {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
  align-self: flex-end;
}

.chat-footer {
  padding: 1rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  gap: 0.75rem;
}

/* ===== Console/Terminal Logs ===== */
.console-box {
  background: #0F172A;
  color: #38BDF8;
  font-family: Consolas, Monaco, 'Andale Mono', monospace;
  font-size: 0.85rem;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid #1E293B;
  height: 500px;
  overflow-y: auto;
  white-space: pre-wrap;
  direction: ltr;
  text-align: left;
  line-height: 1.5;
}

/* Login Page Spec */
.login-body {
  background: var(--bg-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
}

.login-card-wrapper {
  width: 100%;
  max-width: 440px;
}

/* Choice Roles for submission selection */
.role-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
}

.role-choice-card {
  border: 2px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  cursor: pointer;
  background: var(--bg-card);
  transition: all var(--transition-normal);
}

.role-choice-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.role-choice-icon {
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.role-choice-title {
  font-weight: bold;
  font-size: 1rem;
  color: var(--text-primary);
}

.role-choice-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Pagination container */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.25rem;
  margin-top: 1.5rem;
}

.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-weight: bold;
  font-size: 0.85rem;
}

.page-link:hover {
  background: var(--bg-secondary);
}

.page-link.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* ===== Public Layout & Header ===== */
.public-header {
  position: sticky;
  top: 0;
  z-index: 1100;
  background: var(--bg-glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: background var(--transition-normal);
}

.public-nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.public-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.public-brand .brand-text {
  font-size: 1.25rem;
  font-weight: 900;
  color: var(--primary);
}

.public-nav-menu {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.public-nav-link {
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.5rem 0.25rem;
  position: relative;
  transition: color var(--transition-fast);
}

.public-nav-link:hover {
  color: var(--primary);
}

.public-nav-link.active {
  color: var(--primary);
}

.public-nav-link.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--primary);
  border-radius: 2px;
}

.public-nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Public Hero & Sections */
.hero-section {
  background: linear-gradient(135deg, #0F172A 0%, #1E3A8A 50%, #2563EB 100%);
  color: #fff;
  padding: 5rem 1.5rem;
  position: relative;
  overflow: hidden;
  text-align: center;
}

[data-theme="dark"] .hero-section {
  background: linear-gradient(135deg, #020617 0%, #0F172A 50%, #1D4ED8 100%);
}

.hero-bg-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.08;
  background-image: radial-gradient(circle at 20% 50%, #fff 0%, transparent 60%), radial-gradient(circle at 80% 20%, #fff 0%, transparent 60%);
  pointer-events: none;
}

.hero-title {
  font-size: 2.75rem;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 1rem;
  letter-spacing: -0.5px;
  color: #ffffff !important;
}

.hero-subtitle {
  font-size: 1.2rem;
  max-width: 650px;
  margin: 0 auto 2.5rem auto;
  opacity: 0.85;
  font-weight: 400;
  line-height: 1.8;
}

.hero-buttons {
  display: flex;
  justify-content: center;
  gap: 1rem;
}

.hero-btn-primary {
  background: #ffffff;
  color: #1e3a8a;
  border-color: #ffffff;
}

.hero-btn-primary:hover {
  background: #f1f5f9;
  color: #1d4ed8;
}

.hero-btn-secondary {
  border-color: rgba(255, 255, 255, 0.4);
  color: #ffffff;
}

.hero-btn-secondary:hover {
  border-color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff !important;
}

/* Public Stats Strip */
.stats-strip {
  background: var(--primary);
  padding: 1.5rem 0;
  box-shadow: var(--shadow-sm);
}

.stats-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  text-align: center;
  gap: 1rem;
}

.stat-item {
  color: #ffffff;
  border-left: 1px solid rgba(255, 255, 255, 0.15);
}

.stat-item:last-child {
  border-left: none;
}

.stat-num {
  font-size: 1.75rem;
  font-weight: 900;
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.8rem;
  opacity: 0.8;
  font-weight: 500;
}

/* Public Grid & Container */
.public-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 1.5rem;
}

.public-grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}

/* Ad card improvements for browse */
.ad-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-right: 4px solid var(--border-color);
}

.ad-card.employer {
  border-right-color: var(--primary);
}

.ad-card.jobseeker {
  border-right-color: var(--secondary);
}

.ad-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  min-height: 2.8rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ad-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.ad-card-tag {
  background: var(--bg-secondary);
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: var(--radius-sm);
}

.ad-card-footer {
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ad-card-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Responsive Public Menu */
@media (max-width: 768px) {
  .public-nav-menu {
    display: none;
  }
  .stats-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .stat-item {
    border-left: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
    padding-bottom: 1rem;
  }
  .stat-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }
  .hero-title {
    font-size: 2rem;
  }
}

/* SVG icon styling rules */
.icon svg, .brand-icon svg, .btn svg {
  width: 18px;
  height: 18px;
  display: inline-block;
  vertical-align: middle;
}
.sidebar-link svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}
.theme-switch-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* Button hover color overrides to ensure text is white */
.btn-primary:hover, .btn-success:hover, .btn-danger:hover {
  color: #ffffff !important;
}