/**
 * ITM Employer Portal — Modern UI enhancements
 */

:root {
  --itm-primary: #4154f1;
  --itm-primary-dark: #2c3cdd;
  --itm-accent: #7c3aed;
  --itm-success: #10b981;
  --itm-warning: #f59e0b;
  --itm-danger: #ef4444;
  --itm-surface: #ffffff;
  --itm-bg: #f0f2f8;
  --itm-border: #e2e8f0;
  --itm-text: #1e293b;
  --itm-text-muted: #64748b;
  --itm-radius: 12px;
  --itm-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 4px 16px rgba(15, 23, 42, 0.04);
  --itm-shadow-lg: 0 4px 24px rgba(15, 23, 42, 0.1);
}

body {
  background: var(--itm-bg) !important;
  color: var(--itm-text);
}

#main {
  padding: 24px;
}

/* Cards */
.itm-card {
  background: var(--itm-surface);
  border: 1px solid var(--itm-border);
  border-radius: var(--itm-radius);
  box-shadow: var(--itm-shadow);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.itm-card:hover {
  box-shadow: var(--itm-shadow-lg);
}

.itm-card .card-body {
  padding: 1.25rem 1.5rem;
}

/* Stat cards */
.stat-card {
  background: var(--itm-surface);
  border: 1px solid var(--itm-border);
  border-radius: var(--itm-radius);
  padding: 1.25rem;
  box-shadow: var(--itm-shadow);
  height: 100%;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  border-radius: 4px 0 0 4px;
}

.stat-card.stat-primary::before { background: var(--itm-primary); }
.stat-card.stat-success::before { background: var(--itm-success); }
.stat-card.stat-warning::before { background: var(--itm-warning); }
.stat-card.stat-danger::before { background: var(--itm-danger); }
.stat-card.stat-accent::before { background: var(--itm-accent); }

.stat-card .stat-icon {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
}

.stat-card.stat-primary .stat-icon { background: rgba(65, 84, 241, 0.1); color: var(--itm-primary); }
.stat-card.stat-success .stat-icon { background: rgba(16, 185, 129, 0.1); color: var(--itm-success); }
.stat-card.stat-warning .stat-icon { background: rgba(245, 158, 11, 0.1); color: var(--itm-warning); }
.stat-card.stat-danger .stat-icon { background: rgba(239, 68, 68, 0.1); color: var(--itm-danger); }
.stat-card.stat-accent .stat-icon { background: rgba(124, 58, 237, 0.1); color: var(--itm-accent); }

.stat-card .stat-value {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--itm-text);
}

.stat-card .stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--itm-text-muted);
}

.stat-card .stat-sub {
  font-size: 0.78rem;
  color: var(--itm-text-muted);
}

/* Page header */
.itm-page-header {
  margin-bottom: 1.5rem;
}

.itm-page-header h1 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--itm-text);
  margin-bottom: 0.25rem;
}

.itm-page-header .breadcrumb {
  margin-bottom: 0;
  font-size: 0.85rem;
}

/* Filter tabs (Posted Jobs) */
.job-filter-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.job-filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.1rem;
  border-radius: 8px;
  border: 1px solid var(--itm-border);
  background: var(--itm-surface);
  color: var(--itm-text-muted);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
}

.job-filter-btn:hover {
  border-color: var(--itm-primary);
  color: var(--itm-primary);
  background: rgba(65, 84, 241, 0.04);
}

.job-filter-btn.active {
  background: var(--itm-primary);
  border-color: var(--itm-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(65, 84, 241, 0.35);
}

.job-filter-btn .filter-count {
  background: rgba(255, 255, 255, 0.25);
  padding: 0.1rem 0.45rem;
  border-radius: 20px;
  font-size: 0.75rem;
}

.job-filter-btn:not(.active) .filter-count {
  background: var(--itm-bg);
  color: var(--itm-text-muted);
}

/* Premium plan cards */
.premium-plan-card {
  border: 1px solid var(--itm-border);
  border-radius: var(--itm-radius);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  height: 100%;
  background: var(--itm-surface);
}

.premium-plan-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--itm-shadow-lg);
}

.premium-plan-card.featured {
  border-color: var(--itm-primary);
  box-shadow: 0 0 0 2px rgba(65, 84, 241, 0.15);
}

.premium-plan-card .plan-header {
  padding: 1.25rem;
  text-align: center;
}

.premium-plan-card .plan-header.data-plan {
  background: linear-gradient(135deg, var(--itm-primary) 0%, var(--itm-accent) 100%);
  color: #fff;
}

.premium-plan-card .plan-header.job-plan {
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
  color: #fff;
}

.premium-plan-card .plan-price {
  font-size: 2rem;
  font-weight: 700;
}

.premium-plan-card .plan-features li {
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--itm-border);
  font-size: 0.9rem;
}

.premium-plan-card .plan-features li:last-child {
  border-bottom: none;
}

.premium-plan-card .plan-features li i {
  color: var(--itm-success);
  margin-right: 0.5rem;
}

/* Tables */
.itm-table-wrap {
  border-radius: var(--itm-radius);
  overflow: auto;
  border: 1px solid var(--itm-border);
}

.itm-table-wrap .table {
  margin-bottom: 0;
}

.itm-table-wrap .table thead th {
  background: #f8fafc;
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--itm-text-muted);
  border-bottom: 1px solid var(--itm-border);
  white-space: nowrap;
  padding: 9px 4px;
}

.itm-table-wrap .table tbody tr:hover {
  background: rgba(65, 84, 241, 0.02);
}

/* Sidebar polish */
.sidebar {
  box-shadow: 2px 0 12px rgba(15, 23, 42, 0.04);
}

.sidebar-nav .nav-link {
  border-radius: 8px;
  margin: 2px 8px;
  font-size: 1rem;
}

.sidebar-nav .nav-link:not(.collapsed) {
  background: rgba(65, 84, 241, 0.08);
  color: var(--itm-primary);
}

/* Header */
.header {
  box-shadow: 0 1px 8px rgba(15, 23, 42, 0.06) !important;
}

.header .showLeftClick {
  font-weight: 700;
  color: var(--itm-primary);
}

/* Toast container — bottom right */
#itm-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 99999;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  max-width: 380px;
  pointer-events: none;
}

.itm-toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 10px;
  background: var(--itm-surface);
  border: 1px solid var(--itm-border);
  box-shadow: var(--itm-shadow-lg);
  animation: itmToastIn 0.35s cubic-bezier(0.21, 1.02, 0.73, 1);
  min-width: 280px;
}

.itm-toast.itm-toast-out {
  animation: itmToastOut 0.3s ease forwards;
}

.itm-toast-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 1rem;
}

.itm-toast-success .itm-toast-icon { background: rgba(16, 185, 129, 0.12); color: var(--itm-success); }
.itm-toast-error .itm-toast-icon { background: rgba(239, 68, 68, 0.12); color: var(--itm-danger); }
.itm-toast-warning .itm-toast-icon { background: rgba(245, 158, 11, 0.12); color: var(--itm-warning); }
.itm-toast-info .itm-toast-icon { background: rgba(65, 84, 241, 0.12); color: var(--itm-primary); }

.itm-toast-body { flex: 1; min-width: 0; }
.itm-toast-title { font-weight: 700; font-size: 0.875rem; margin-bottom: 2px; }
.itm-toast-message { font-size: 0.82rem; color: var(--itm-text-muted); line-height: 1.4; }

.itm-toast-close {
  background: none;
  border: none;
  color: var(--itm-text-muted);
  cursor: pointer;
  padding: 0;
  font-size: 1.1rem;
  line-height: 1;
  opacity: 0.6;
  flex-shrink: 0;
}

.itm-toast-close:hover { opacity: 1; }

@keyframes itmToastIn {
  from { opacity: 0; transform: translateX(40px) scale(0.95); }
  to { opacity: 1; transform: translateX(0) scale(1); }
}

@keyframes itmToastOut {
  from { opacity: 1; transform: translateX(0); }
  to { opacity: 0; transform: translateX(40px); }
}

/* Confirm modal overlay */
.itm-confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 99998;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.2s ease;
}

.itm-confirm-box {
  background: var(--itm-surface);
  border-radius: var(--itm-radius);
  padding: 1.5rem;
  max-width: 400px;
  width: 90%;
  box-shadow: var(--itm-shadow-lg);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Dashboard section titles */
.section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--itm-text);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.section-title i {
  color: var(--itm-primary);
}

/* Responsive */
@media (max-width: 768px) {
  #itm-toast-container {
    left: 16px;
    right: 16px;
    bottom: 16px;
    max-width: none;
  }
  .itm-toast { min-width: auto; }
}
