/* ==============================================
   Job Tracker Dashboard — style.css
   Dark glassmorphism theme, Inter font
   ============================================== */

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

:root {
  --bg:           #0d0f17;
  --surface:      #151929;
  --surface-2:    #1c2138;
  --border:       rgba(255,255,255,0.07);
  --text:         #e8eaf0;
  --text-muted:   #7b82a0;
  --accent:       #6366f1;
  --accent-hover: #818cf8;
  --blue:         #3b82f6;
  --green:        #22c55e;
  --yellow:       #f59e0b;
  --red:          #ef4444;
  --radius:       12px;
  --radius-sm:    8px;
  --shadow:       0 4px 24px rgba(0,0,0,0.4);
  --transition:   0.2s ease;
}

html { font-size: 15px; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

/* ---- Header ---- */
.header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}
.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
  height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.logo { display: flex; align-items: center; gap: 10px; }
.logo-icon { font-size: 1.5rem; }
.logo-text {
  font-size: 1.2rem;
  font-weight: 700;
  background: linear-gradient(135deg, #818cf8, #6366f1);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.header-actions { display: flex; gap: 10px; }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
}
.btn-primary:hover { background: var(--accent-hover); transform: translateY(-1px); }
.btn-outline {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { background: var(--surface-2); border-color: var(--accent); }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger:hover { background: #dc2626; }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }

/* ---- Main layout ---- */
.main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px 24px 80px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* ---- Stats Bar ---- */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  position: relative;
  overflow: hidden;
  transition: transform var(--transition), box-shadow var(--transition);
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: var(--accent);
}
.stat-card.accent-blue::before  { background: var(--blue); }
.stat-card.accent-yellow::before { background: var(--yellow); }
.stat-card.accent-green::before { background: var(--green); }
.stat-card.accent-red::before   { background: var(--red); }
.stat-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 6px;
}
.stat-label { font-size: 0.8rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* ---- Filters Section ---- */
.filters-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.filters-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.filters-row-2 { gap: 10px; }

/* Date tabs */
.date-tabs { display: flex; gap: 4px; background: var(--bg); border-radius: var(--radius-sm); padding: 4px; }
.tab-btn {
  padding: 7px 16px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.tab-btn:hover { color: var(--text); background: var(--surface); }
.tab-btn.active { background: var(--accent); color: #fff; }

/* Custom date pickers */
.custom-date-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: 0.85rem;
}
.date-input {
  padding: 7px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
}
.date-input:focus { outline: none; border-color: var(--accent); }

/* Filter selects & search */
.filter-select, .search-input {
  padding: 8px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.85rem;
  transition: border-color var(--transition);
}
.filter-select { min-width: 160px; cursor: pointer; }
.search-input  { flex: 1; min-width: 200px; }
.filter-select:focus, .search-input:focus { outline: none; border-color: var(--accent); }

/* Results meta */
.results-meta { color: var(--text-muted); font-size: 0.85rem; padding: 0 2px; }

/* ---- Table ---- */
.table-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.table-wrapper { overflow-x: auto; }

.jobs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}
.jobs-table thead {
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
}
.jobs-table th {
  padding: 13px 16px;
  text-align: left;
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.jobs-table td {
  padding: 13px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  vertical-align: middle;
}
.jobs-table tbody tr:last-child td { border-bottom: none; }
.jobs-table tbody tr {
  transition: background var(--transition);
  cursor: default;
}
.jobs-table tbody tr:hover { background: var(--surface-2); }

/* Job title link */
.job-title-link {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}
.job-title-link:hover { color: var(--accent-hover); text-decoration: underline; }

/* Portal badge */
.portal-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}
.portal-linkedin { background: rgba(59,130,246,0.15); color: #60a5fa; }
.portal-naukri   { background: rgba(99,102,241,0.15);  color: #818cf8; }
.portal-indeed   { background: rgba(245,158,11,0.15);  color: #fbbf24; }
.portal-other    { background: rgba(107,114,128,0.15); color: #9ca3af; }

/* Status badge */
.status-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  white-space: nowrap;
}
.status-applied            { background: rgba(99,102,241,0.15);  color: #818cf8; }
.status-under-review       { background: rgba(59,130,246,0.15);  color: #60a5fa; }
.status-screening-call     { background: rgba(245,158,11,0.15);  color: #fbbf24; }
.status-interview-scheduled{ background: rgba(245,158,11,0.2);   color: #f59e0b; }
.status-offer-received     { background: rgba(34,197,94,0.15);   color: #4ade80; }
.status-rejected           { background: rgba(239,68,68,0.15);   color: #f87171; }
.status-ghosted            { background: rgba(107,114,128,0.15); color: #9ca3af; }
.status-withdrawn          { background: rgba(107,114,128,0.1);  color: #6b7280; }

/* Action buttons */
.action-btns { display: flex; gap: 6px; }
.action-btn {
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-muted);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
}
.action-btn:hover          { background: var(--surface-2); color: var(--text); }
.action-btn.edit:hover     { border-color: var(--accent); color: var(--accent-hover); }
.action-btn.delete:hover   { border-color: var(--red); color: var(--red); }

/* Loading / empty row */
.loading-row, .empty-row {
  text-align: center;
  color: var(--text-muted);
  padding: 48px 16px !important;
  font-size: 0.9rem;
}
.empty-row-icon { font-size: 2.5rem; display: block; margin-bottom: 10px; }

/* ---- Modal ---- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  animation: slideUp 0.2s ease;
}
.modal-sm { max-width: 420px; }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-header {
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-header h2 { font-size: 1.1rem; font-weight: 600; }
.modal-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all var(--transition);
}
.modal-close:hover { background: var(--surface-2); color: var(--text); }

/* Modal form */
.modal-form { padding: 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.8rem; font-weight: 500; color: var(--text-muted); }
.form-group input, .form-group select, .form-group textarea {
  padding: 9px 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.875rem;
  transition: border-color var(--transition);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.1);
}
.form-group textarea { resize: vertical; min-height: 80px; }

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

/* Delete modal */
.delete-msg { padding: 16px 24px; color: var(--text-muted); font-size: 0.9rem; }

/* ---- Toast ---- */
.toast {
  position: fixed;
  bottom: 28px;
  right: 28px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  z-index: 9999;
  box-shadow: var(--shadow);
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.25s ease;
  pointer-events: none;
  max-width: 360px;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.success { border-left: 3px solid var(--green); }
.toast.error   { border-left: 3px solid var(--red); }

/* ---- Responsive ---- */
@media (max-width: 900px) {
  .stats-bar { grid-template-columns: repeat(3, 1fr); }
  .form-row  { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .stats-bar        { grid-template-columns: 1fr 1fr; }
  .header-inner     { padding: 0 16px; }
  .main             { padding: 16px 16px 60px; }
  .filters-section  { padding: 14px; }
  .date-tabs        { flex-wrap: wrap; }
}
