/* ==========================================
   DASHBOARD CORE LAYOUT
   ========================================== */
.dashboard-container {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: calc(100vh - 72px);
  position: relative;
}

/* Sidebar navigation */
.sidebar {
  background-color: var(--bg-primary);
  border-right: 1px solid var(--border-color);
  padding: var(--spacing-md);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: sticky;
  top: 72px;
  height: calc(100vh - 72px);
  overflow-y: auto;
}

.sidebar-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  color: var(--text-secondary);
  font-weight: 500;
  border-radius: var(--radius-md);
  transition: var(--transition-fast);
}

.sidebar-link svg {
  width: 20px;
  height: 20px;
  stroke: var(--text-muted);
  stroke-width: 2;
  fill: none;
  transition: var(--transition-fast);
}

.sidebar-link:hover, 
.sidebar-link.active {
  background-color: var(--primary-light);
  color: var(--primary);
}

.sidebar-link:hover svg, 
.sidebar-link.active svg {
  stroke: var(--primary);
}

.sidebar-footer {
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
  margin-top: 16px;
}

/* Content Area */
.dashboard-content {
  padding: var(--spacing-md);
  background-color: var(--bg-secondary);
  overflow-x: hidden;
}

.dashboard-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--spacing-md);
  gap: 16px;
  flex-wrap: wrap;
}

.dashboard-title h2 {
  margin-bottom: 4px;
}

/* ==========================================
   STAT CARDS
   ========================================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: var(--spacing-md);
}

.stat-card {
  background-color: var(--bg-primary);
  border-radius: var(--radius-md);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: var(--transition-normal);
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-light);
}

.stat-info h3 {
  font-size: 2rem;
  margin-bottom: 2px;
  font-family: var(--font-heading);
}

.stat-info p {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 0;
  font-weight: 500;
}

.stat-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background-color: var(--primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon svg {
  width: 24px;
  height: 24px;
  stroke: var(--primary);
  fill: none;
}

.stat-icon.orange {
  background-color: var(--accent-light);
}

.stat-icon.orange svg {
  stroke: var(--accent);
}

/* ==========================================
   CARDS & TABLES
   ========================================== */
.card {
  background-color: var(--bg-primary);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--spacing-md);
  overflow: hidden;
}

.card-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.card-body {
  padding: 24px;
}

/* Responsive Table Wrapper */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.925rem;
}

.table th {
  background-color: var(--bg-secondary);
  padding: 14px 20px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-color);
}

.table td {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  vertical-align: middle;
}

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

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: var(--radius-round);
  font-size: 0.775rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.badge-pending {
  background-color: var(--accent-light);
  color: var(--accent);
}

.badge-success {
  background-color: #ecfdf5;
  color: var(--success);
}

.badge-warning {
  background-color: #fffbeb;
  color: var(--warning);
}

.badge-danger {
  background-color: #fef2f2;
  color: var(--danger);
}

/* ==========================================
   TAB COMPONENT
   ========================================== */
.tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: var(--spacing-md);
  gap: 24px;
}

.tab {
  padding: 12px 4px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  position: relative;
  transition: var(--transition-fast);
}

.tab:hover, .tab.active {
  color: var(--primary);
}

.tab.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 2px;
  background-color: var(--primary);
}

.tab-pane {
  display: none;
}

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

/* ==========================================
   MODALS
   ========================================== */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(15, 23, 42, 0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  pointer-events: none;
  transition: var(--transition-normal);
}

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

.modal {
  background-color: var(--bg-primary);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px);
  transition: var(--transition-normal);
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

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

.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  color: var(--text-muted);
  cursor: pointer;
}

.modal-body {
  padding: 24px;
}

/* ==========================================
   RESPONSIVE DESIGN (DASHBOARD)
   ========================================== */
@media (max-width: 991px) {
  .dashboard-container {
    grid-template-columns: 1fr;
  }
  
  .sidebar {
    position: fixed;
    bottom: 0;
    top: auto;
    left: 0;
    width: 100%;
    height: 64px;
    flex-direction: row;
    padding: 0 var(--spacing-sm);
    z-index: 100;
    border-right: none;
    border-top: 1px solid var(--border-color);
    box-shadow: 0 -4px 10px rgba(0,0,0,0.05);
    overflow: hidden;
  }
  
  .sidebar-menu {
    flex-direction: row;
    justify-content: space-around;
    width: 100%;
    gap: 4px;
  }
  
  .sidebar-link {
    flex-direction: column;
    font-size: 0.75rem;
    padding: 8px;
    gap: 4px;
    align-items: center;
    justify-content: center;
  }
  
  .sidebar-link span {
    display: block;
  }
  
  .sidebar-link svg {
    width: 18px;
    height: 18px;
  }
  
  .sidebar-footer {
    display: none;
  }
  
  .dashboard-content {
    padding-bottom: 80px; /* Space for mobile nav bar */
  }
}

/* ==========================================
   HELP CENTER & LIVE CHAT SUPPORT STYLES
   ========================================== */
.help-center-layout {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  align-items: start;
}

.help-faq-panel, .help-chat-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
}

@media (max-width: 991px) {
  .help-center-layout {
    grid-template-columns: 1fr;
    gap: 20px;
    align-items: start;
  }
  
  .help-faq-panel, .help-chat-panel {
    height: auto;
  }
}

/* FAQ Accordion */
.faq-accordion {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.faq-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition-fast);
}

.faq-question {
  padding: 16px;
  background-color: var(--bg-primary);
  font-weight: 600;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  transition: var(--transition-fast);
}

.faq-question:hover {
  background-color: var(--primary-light);
  color: var(--primary);
}

.faq-toggle-icon {
  font-size: 1.2rem;
  font-weight: 700;
  transition: transform 0.2s ease;
}

.faq-item.active .faq-toggle-icon {
  transform: rotate(45deg);
}

.faq-answer {
  padding: 0 16px;
  max-height: 0;
  overflow: hidden;
  transition: all 0.3s ease;
  color: var(--text-secondary);
  line-height: 1.6;
  font-size: 0.925rem;
}

.faq-item.active .faq-answer {
  padding: 16px;
  max-height: 300px;
  border-top: 1px solid var(--border-color);
}

/* Live Chat Widget Box */
.chat-widget-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
}

/* Specific styling for the Help Center chat wrapper to control overall widget height */
.help-chat-panel .chat-widget-body {
  height: 500px;
  min-height: 500px;
  max-height: 500px;
  flex: none;
}

.chat-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  color: var(--text-muted);
}

.chat-placeholder p {
  font-size: 0.95rem;
  max-width: 280px;
  margin: 0;
  line-height: 1.5;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.chat-box-container {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* Restrict chat box height specifically for Help Support panels on Employer and Worker dashboards to prevent page expansion and enable scrolling */
.help-chat-panel .chat-messages {
  flex: 1;
  min-height: 0;
  max-height: 100%;
  overflow-y: auto;
}

.chat-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 0.925rem;
  line-height: 1.4;
  position: relative;
  word-wrap: break-word;
}

/* Chat bubble styling for Candidate/Employer Side */
.chat-bubble.sent-user {
  background-color: var(--primary);
  color: #ffffff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  margin-right: 12px;
}

.chat-bubble.received-user {
  background-color: var(--bg-secondary);
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  margin-left: 12px;
}

/* Chat bubble styling for System/Rep Status messages */
.chat-bubble.system-msg {
  background-color: #f1f5f9;
  color: #475569;
  font-style: italic;
  font-size: 0.825rem;
  align-self: center;
  text-align: center;
  max-width: 90%;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

/* Chat Queue & Past Chats items */
.queue-item, .past-chat-item {
  background: var(--bg-primary);
  border: 1px solid var(--border-color);
  padding: 12px;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.queue-item:hover, .past-chat-item:hover {
  border-color: var(--primary-light);
  background: var(--primary-light);
}

.queue-item.active, .past-chat-item.active {
  border-color: var(--primary);
  background: var(--primary-light);
}

.queue-item-meta, .past-chat-item-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.775rem;
  color: var(--text-muted);
}

.queue-item-name, .past-chat-item-name {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary);
}

.queue-item-inquiry, .past-chat-item-id {
  font-size: 0.825rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Switch toggle style */
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #cbd5e1;
  transition: .3s;
  border-radius: 24px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}

.switch input:checked + .slider {
  background-color: var(--accent) !important;
}

.switch input:checked + .slider:before {
  transform: translateX(20px);
}
