/* ===== RASEEN ATS - DARK MODE THEME ===== */
@import url('https://fonts.googleapis.com/css2?family=Tajawal:wght@300;400;500;700;800&display=swap');

:root {
  --bg-base: #0a0e1a;
  --bg-card: #111827;
  --bg-card2: #1a2235;
  --bg-hover: #1e2d45;
  --border: #1e3a5f;
  --border-light: #243b5c;
  --accent: #7c3aed;
  --accent2: #6d28d9;
  --accent-glow: rgba(124,58,237,0.3);
  --neon-blue: #38bdf8;
  --neon-green: #34d399;
  --neon-red: #f87171;
  --neon-orange: #fb923c;
  --neon-yellow: #fbbf24;
  --neon-purple: #c084fc;
  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  --shadow: 0 4px 24px rgba(0,0,0,0.4);
  --shadow-glow: 0 0 20px rgba(124,58,237,0.2);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: all 0.2s ease;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Tajawal', sans-serif;
  background: var(--bg-base);
  color: var(--text-primary);
  direction: rtl;
  overflow-x: hidden;
}

/* ===== SCROLLBAR ===== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg-base); }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 3px; }

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed;
  right: 0; top: 0; bottom: 0;
  width: 260px;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  z-index: 100;
  display: flex;
  flex-direction: column;
  transition: var(--transition);
}

.sidebar-logo {
  padding: 24px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-logo .logo-icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, var(--accent), var(--neon-blue));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  box-shadow: 0 0 15px var(--accent-glow);
}

.sidebar-logo .logo-text {
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--neon-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-logo .logo-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.sidebar-nav { flex: 1; padding: 16px 0; overflow-y: auto; }

.nav-section-title {
  font-size: 10px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  padding: 8px 20px 4px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 20px;
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
  border-right: 3px solid transparent;
  position: relative;
  font-size: 14px;
  font-weight: 500;
}

.nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-right-color: var(--accent);
}

.nav-item.active {
  background: var(--accent-glow);
  color: var(--text-primary);
  border-right-color: var(--accent);
}

.nav-item .nav-icon {
  width: 20px;
  text-align: center;
  font-size: 16px;
}

.nav-item .nav-badge {
  margin-right: auto;
  background: var(--accent);
  color: white;
  font-size: 10px;
  padding: 2px 7px;
  border-radius: 10px;
}

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

.user-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--bg-card2);
  border-radius: var(--radius-sm);
}

.user-avatar {
  width: 36px; height: 36px;
  background: linear-gradient(135deg, var(--accent), var(--neon-blue));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: white;
  flex-shrink: 0;
}

.user-info .user-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.user-info .user-role {
  font-size: 11px;
  color: var(--text-muted);
}

/* ===== TOPBAR ===== */
.topbar {
  position: fixed;
  top: 0; left: 0;
  right: 260px;
  height: 64px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  z-index: 99;
  display: flex;
  align-items: center;
  padding: 0 24px;
  gap: 16px;
}

.topbar-title {
  font-size: 18px;
  font-weight: 700;
  flex: 1;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===== MAIN CONTENT ===== */
.main-content {
  margin-right: 260px;
  margin-top: 64px;
  padding: 28px;
  min-height: calc(100vh - 64px);
}

/* ===== CARDS ===== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}

.card-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ===== STAT CARDS ===== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--card-accent, var(--accent));
}

.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.stat-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: var(--card-accent-bg, rgba(124,58,237,0.15));
  color: var(--card-accent, var(--accent));
  flex-shrink: 0;
}

.stat-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1;
}

.stat-label {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.stat-change {
  font-size: 12px;
  color: var(--neon-green);
  margin-top: 2px;
}

/* ===== TABLES ===== */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

thead th {
  background: var(--bg-card2);
  color: var(--text-secondary);
  font-weight: 600;
  padding: 14px 16px;
  text-align: right;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}

tbody tr {
  border-bottom: 1px solid var(--border);
  transition: var(--transition);
}

tbody tr:last-child { border-bottom: none; }

tbody tr:hover { background: var(--bg-hover); }

td {
  padding: 14px 16px;
  color: var(--text-primary);
  vertical-align: middle;
}

/* ===== BADGES ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-matching { background: rgba(52,211,153,0.15); color: var(--neon-green); }
.badge-waiting { background: rgba(251,191,36,0.15); color: var(--neon-yellow); }
.badge-nonmatching { background: rgba(248,113,113,0.15); color: var(--neon-red); }
.badge-unclassified { background: rgba(148,163,184,0.15); color: var(--text-secondary); }
.badge-rejected { background: rgba(248,113,113,0.2); color: #fc8181; }
.badge-hired { background: rgba(52,211,153,0.2); color: var(--neon-green); }
.badge-pending { background: rgba(124,58,237,0.15); color: var(--neon-purple); }
.badge-blue { background: rgba(56,189,248,0.15); color: var(--neon-blue); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  font-family: 'Tajawal', sans-serif;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: white;
  box-shadow: 0 0 15px var(--accent-glow);
}
.btn-primary:hover { background: var(--accent2); transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.btn-outline:hover { border-color: var(--accent); color: var(--text-primary); background: var(--accent-glow); }

.btn-danger { background: rgba(248,113,113,0.2); color: var(--neon-red); border: 1px solid rgba(248,113,113,0.3); }
.btn-danger:hover { background: rgba(248,113,113,0.3); }

.btn-success { background: rgba(52,211,153,0.2); color: var(--neon-green); border: 1px solid rgba(52,211,153,0.3); }
.btn-success:hover { background: rgba(52,211,153,0.3); }

.btn-sm { padding: 6px 12px; font-size: 12px; }
.btn-lg { padding: 12px 24px; font-size: 16px; }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); background: var(--bg-card2); color: var(--text-secondary); border: 1px solid var(--border); cursor: pointer; transition: var(--transition); }
.btn-icon:hover { color: var(--accent); border-color: var(--accent); }

/* ===== FORMS ===== */
.form-group { margin-bottom: 18px; }

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-control, .form-select {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: 'Tajawal', sans-serif;
  font-size: 14px;
  transition: var(--transition);
  outline: none;
}

.form-control:focus, .form-select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.form-control::placeholder { color: var(--text-muted); }

textarea.form-control { min-height: 100px; resize: vertical; }

.form-select option { background: var(--bg-card); }

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active { display: flex; }

.modal {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: modalIn 0.2s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: scale(0.96) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

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

.modal-title {
  font-size: 17px;
  font-weight: 700;
}

.modal-body { padding: 24px; }

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ===== PIPELINE ===== */
.pipeline-track {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 8px 0;
}

.pipeline-step {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.pipeline-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--text-muted);
}

.pipeline-dot.active { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.pipeline-dot.done { background: var(--neon-green); box-shadow: 0 0 8px var(--neon-green); }
.pipeline-dot.rejected { background: var(--neon-red); }

.pipeline-line { width: 24px; height: 2px; background: var(--border); }

/* ===== SCORE RING ===== */
.score-ring-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.score-ring {
  position: relative;
  width: 80px; height: 80px;
}

.score-ring svg {
  transform: rotate(-90deg);
}

.score-ring .score-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
}

/* ===== RATING STARS ===== */
.rating-input {
  display: flex;
  gap: 4px;
  flex-direction: row-reverse;
}

.rating-input input { display: none; }

.rating-input label {
  font-size: 24px;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
  margin: 0;
}

.rating-input input:checked ~ label,
.rating-input label:hover,
.rating-input label:hover ~ label {
  color: var(--neon-yellow);
}

/* ===== NOTIFICATION BELL ===== */
.notif-btn {
  position: relative;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  width: 40px; height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition);
}

.notif-btn:hover { color: var(--accent); border-color: var(--accent); }

.notif-badge {
  position: absolute;
  top: -4px; left: -4px;
  background: var(--neon-red);
  color: white;
  font-size: 10px;
  width: 18px; height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
}

.notif-dropdown {
  position: absolute;
  top: 48px; left: 0;
  width: 340px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 300;
  display: none;
}

.notif-dropdown.open { display: block; }

.notif-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
}

.notif-list { max-height: 320px; overflow-y: auto; }

.notif-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: var(--transition);
}

.notif-item:hover { background: var(--bg-hover); }
.notif-item.unread { border-right: 3px solid var(--accent); }
.notif-item-title { font-size: 13px; font-weight: 600; margin-bottom: 3px; }
.notif-item-msg { font-size: 12px; color: var(--text-secondary); }
.notif-item-time { font-size: 10px; color: var(--text-muted); margin-top: 4px; }

/* ===== SEARCH ===== */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.search-box input {
  padding: 9px 14px 9px 38px;
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text-primary);
  font-family: 'Tajawal', sans-serif;
  font-size: 13px;
  outline: none;
  width: 220px;
  transition: var(--transition);
}

.search-box input:focus { border-color: var(--accent); width: 280px; }
.search-box .search-icon { position: absolute; left: 12px; color: var(--text-muted); font-size: 14px; }

/* ===== CHARTS PLACEHOLDER ===== */
.chart-container {
  position: relative;
  height: 220px;
}

/* ===== PAGE HEADER ===== */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}

.page-title {
  font-size: 22px;
  font-weight: 800;
}

.page-subtitle {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ===== FILTER BAR ===== */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  margin-bottom: 20px;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-secondary);
}

.empty-state .empty-icon {
  font-size: 56px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state p { font-size: 15px; }

/* ===== ALERTS ===== */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  border: 1px solid;
  margin-bottom: 16px;
}

.alert-success { background: rgba(52,211,153,0.1); border-color: rgba(52,211,153,0.3); color: var(--neon-green); }
.alert-error { background: rgba(248,113,113,0.1); border-color: rgba(248,113,113,0.3); color: var(--neon-red); }
.alert-warning { background: rgba(251,191,36,0.1); border-color: rgba(251,191,36,0.3); color: var(--neon-yellow); }
.alert-info { background: rgba(56,189,248,0.1); border-color: rgba(56,189,248,0.3); color: var(--neon-blue); }

/* ===== TABS ===== */
.tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-card2);
  padding: 4px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
}

.tab {
  flex: 1;
  padding: 9px 16px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition);
  text-align: center;
  border: none;
  background: none;
  font-family: 'Tajawal', sans-serif;
}

.tab.active {
  background: var(--accent);
  color: white;
  box-shadow: 0 0 10px var(--accent-glow);
}

/* ===== PROGRESS BAR ===== */
.progress-bar { background: var(--bg-card2); border-radius: 4px; height: 8px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 4px; background: var(--accent); transition: width 0.4s ease; }

/* ===== GRID ===== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(260px); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-right: 0; }
  .topbar { right: 0; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .main-content { padding: 16px; }
  .stat-grid { grid-template-columns: 1fr 1fr; }
}

/* ===== LOGIN ===== */
.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at 50% 0%, rgba(124,58,237,0.15) 0%, var(--bg-base) 70%);
  padding: 20px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 40px 36px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.5);
}

.login-logo {
  text-align: center;
  margin-bottom: 32px;
}

.login-logo .big-icon {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, var(--accent), var(--neon-blue));
  border-radius: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  margin: 0 auto 14px;
  box-shadow: 0 0 30px var(--accent-glow);
}

.login-logo h1 {
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--neon-blue));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-logo p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 4px;
}

/* ===== TIMELINE ===== */
.timeline { display: flex; flex-direction: column; gap: 12px; }

.timeline-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.timeline-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  margin-top: 5px;
  flex-shrink: 0;
  box-shadow: 0 0 8px var(--accent);
}

.timeline-content .tl-time {
  font-size: 11px;
  color: var(--text-muted);
}

.timeline-content .tl-text {
  font-size: 13px;
  color: var(--text-primary);
  margin-top: 2px;
}

/* ===== DRAG SLOT ===== */
.slot-card {
  background: var(--bg-card2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: var(--transition);
}

.slot-card:hover { border-color: var(--accent); }
.slot-card.filled { border-color: var(--neon-green); background: rgba(52,211,153,0.05); }

/* ===== INTERVIEW TIMER ===== */
.interview-timer {
  background: linear-gradient(135deg, var(--accent), var(--neon-blue));
  color: white;
  padding: 16px 24px;
  border-radius: var(--radius);
  text-align: center;
  font-size: 32px;
  font-weight: 800;
  letter-spacing: 4px;
  box-shadow: 0 0 20px var(--accent-glow);
}

/* ===== CV VIEWER ===== */
.cv-preview-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--neon-blue);
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
}

.cv-preview-btn:hover { color: var(--accent); }

/* ===== TOOLTIP ===== */
[data-tooltip] { position: relative; }
[data-tooltip]:hover::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: 100%;
  right: 50%;
  transform: translateX(50%);
  background: var(--bg-card2);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 5px 10px;
  border-radius: 6px;
  font-size: 12px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 400;
}

/* ===== ANIMATIONS ===== */
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.5} }
@keyframes fadeIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }
.animate-fade { animation: fadeIn 0.3s ease; }
.animate-pulse { animation: pulse 2s infinite; }
