/* =============================================
   JOB PROFILE MANAGER — PREMIUM DARK UI
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* --- CSS Variables / Design Tokens --- */
:root {
  --bg-primary: #06060f;
  --bg-secondary: #0d0d1f;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-hover: rgba(139, 92, 246, 0.4);

  --accent-primary: #6366f1;
  --accent-secondary: #a855f7;
  --accent-success: #10b981;
  --accent-danger: #ef4444;
  --accent-warning: #f59e0b;
  --accent-info: #3b82f6;

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #475569;
  --text-accent: #818cf8;

  --gradient-primary: linear-gradient(135deg, #6366f1, #a855f7);
  --gradient-bg: linear-gradient(135deg, #06060f 0%, #0d0a1f 50%, #06060f 100%);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 24px 64px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.2);

  --transition: 0.25s ease;
  --font: 'Inter', -apple-system, sans-serif;

  --sidebar-width: 260px;
  --header-height: 64px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* --- Background --- */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: var(--gradient-bg);
  z-index: -2;
}

/* --- Animated Orbs --- */
.bg-orbs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  opacity: 0.15;
  animation: floatOrb 20s ease-in-out infinite;
}

.orb-1 { width: 600px; height: 600px; background: #6366f1; top: -200px; left: -200px; animation-delay: 0s; }
.orb-2 { width: 400px; height: 400px; background: #a855f7; bottom: -100px; right: -100px; animation-delay: -7s; }
.orb-3 { width: 300px; height: 300px; background: #3b82f6; top: 50%; left: 50%; animation-delay: -14s; }

@keyframes floatOrb {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -40px) scale(1.1); }
  66% { transform: translate(-30px, 30px) scale(0.9); }
}

/* --- Glass Card --- */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md), var(--shadow-glow);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.glass-card:hover { border-color: var(--glass-border-hover); }

/* =============================================
   AUTH / LOGIN PAGE
   ============================================= */
.auth-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 24px; }

.login-container { width: 100%; max-width: 420px; animation: slideUp 0.6s ease; }

@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.login-card { padding: 48px 40px; }

.login-header { text-align: center; margin-bottom: 36px; }

.logo-icon { display: inline-flex; margin-bottom: 16px; filter: drop-shadow(0 0 20px rgba(99,102,241,0.5)); }

.login-title { font-size: 1.75rem; font-weight: 800; background: var(--gradient-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; margin-bottom: 8px; }

.login-subtitle { color: var(--text-secondary); font-size: 0.9rem; }

.login-form { display: flex; flex-direction: column; gap: 20px; }

.form-group { display: flex; flex-direction: column; gap: 8px; }

.form-group label { font-size: 0.85rem; font-weight: 500; color: var(--text-secondary); letter-spacing: 0.3px; }

.input-wrapper { position: relative; display: flex; align-items: center; }

.input-icon {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
  transition: color var(--transition);
  flex-shrink: 0;
}

.input-wrapper input {
  width: 100%;
  padding: 13px 44px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.95rem;
  transition: all var(--transition);
  outline: none;
}

.input-wrapper input:focus {
  border-color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.08);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15);
}

.input-wrapper input:focus + .input-icon,
.input-wrapper .input-icon { color: var(--text-muted); }
.input-wrapper input:focus ~ .input-icon { color: var(--accent-primary); }

.toggle-password {
  position: absolute;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  transition: color var(--transition);
}
.toggle-password:hover { color: var(--text-primary); }

.error-message {
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.3);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: #fca5a5;
  font-size: 0.85rem;
}

.login-footer { text-align: center; margin-top: 24px; color: var(--text-muted); font-size: 0.8rem; }

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-md);
  font-family: var(--font);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--gradient-primary);
  color: white;
  box-shadow: 0 4px 20px rgba(99, 102, 241, 0.4);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 8px 30px rgba(99, 102, 241, 0.5); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: 0.6; transform: none; cursor: not-allowed; }

.btn-secondary {
  background: rgba(255,255,255,0.06);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
}
.btn-secondary:hover { background: rgba(255,255,255,0.1); border-color: var(--glass-border-hover); }

.btn-danger { background: rgba(239,68,68,0.15); color: #fca5a5; border: 1px solid rgba(239,68,68,0.3); }
.btn-danger:hover { background: rgba(239,68,68,0.25); }

.btn-success { background: rgba(16,185,129,0.15); color: #6ee7b7; border: 1px solid rgba(16,185,129,0.3); }
.btn-success:hover { background: rgba(16,185,129,0.25); }

.btn-sm { padding: 8px 16px; font-size: 0.8rem; }
.btn-full { width: 100%; }
.btn-icon { padding: 8px; border-radius: var(--radius-sm); }

.btn-loader {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =============================================
   DASHBOARD LAYOUT
   ============================================= */
.dashboard-layout {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-width);
  background: rgba(0,0,0,0.3);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: transform var(--transition);
}

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

.sidebar-logo-icon { flex-shrink: 0; }

.sidebar-logo-text h2 {
  font-size: 0.9rem;
  font-weight: 700;
  background: var(--gradient-primary);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.sidebar-logo-text p { font-size: 0.7rem; color: var(--text-muted); }

.sidebar-nav {
  flex: 1;
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  overflow-y: auto;
}

.nav-section-label {
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 12px 8px 6px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}
.nav-item:hover { background: rgba(255,255,255,0.06); color: var(--text-primary); }
.nav-item.active { background: rgba(99,102,241,0.15); color: var(--text-accent); border: 1px solid rgba(99,102,241,0.2); }
.nav-item svg { flex-shrink: 0; }

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

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(255,255,255,0.04);
  margin-bottom: 8px;
}
.user-avatar {
  width: 32px; height: 32px;
  background: var(--gradient-primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.75rem; font-weight: 700; color: white;
  flex-shrink: 0;
}
.user-name { font-size: 0.85rem; font-weight: 600; }
.user-role { font-size: 0.7rem; color: var(--text-muted); }

/* --- Main Content --- */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* --- Top Header --- */
.top-header {
  height: var(--header-height);
  background: rgba(6,6,15,0.8);
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(20px);
}

.header-left h1 { font-size: 1.1rem; font-weight: 700; }
.header-left p { font-size: 0.8rem; color: var(--text-muted); }

.header-right { display: flex; align-items: center; gap: 12px; }

.status-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}
.status-badge.online { background: rgba(16,185,129,0.15); color: #6ee7b7; border: 1px solid rgba(16,185,129,0.3); }
.status-badge.offline { background: rgba(239,68,68,0.15); color: #fca5a5; border: 1px solid rgba(239,68,68,0.3); }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100%{opacity:1}50%{opacity:0.5} }

/* --- Content Area --- */
.content-area {
  flex: 1;
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* --- Tab Panels --- */
.tab-panel { display: none; animation: fadeIn 0.3s ease; }
.tab-panel.active { display: block; }
@keyframes fadeIn { from{opacity:0;transform:translateY(8px)} to{opacity:1;transform:translateY(0)} }

/* --- Section Cards --- */
.section-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 28px;
  transition: border-color var(--transition);
}
.section-card:hover { border-color: rgba(99,102,241,0.2); }

.section-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
}
.section-card-title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1rem;
  font-weight: 700;
}
.section-card-title svg { color: var(--accent-primary); }

/* --- Form Elements --- */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-grid.cols-1 { grid-template-columns: 1fr; }

.field-group { display: flex; flex-direction: column; gap: 6px; }
.field-group.span-2 { grid-column: span 2; }
.field-group.span-full { grid-column: 1 / -1; }

.field-group label {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.field-group input,
.field-group select,
.field-group textarea {
  padding: 11px 14px;
  background: rgba(255,255,255,0.05);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.9rem;
  outline: none;
  transition: all var(--transition);
  width: 100%;
}

.field-group input:focus,
.field-group select:focus,
.field-group textarea:focus {
  border-color: var(--accent-primary);
  background: rgba(99,102,241,0.07);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}

.field-group textarea { resize: vertical; min-height: 100px; }
.field-group select option { background: #1a1a2e; }

/* --- Dynamic List Items (Education / Experience) --- */
.list-item-card {
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 20px;
  position: relative;
  transition: border-color var(--transition);
  margin-bottom: 12px;
}
.list-item-card:hover { border-color: rgba(99,102,241,0.3); }

.list-item-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.list-item-number {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-accent);
  background: rgba(99,102,241,0.1);
  padding: 4px 10px;
  border-radius: 20px;
}
.list-item-actions { display: flex; gap: 6px; }

.add-more-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 20px;
  background: rgba(99,102,241,0.08);
  border: 1px dashed rgba(99,102,241,0.3);
  border-radius: var(--radius-md);
  color: var(--text-accent);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  width: 100%;
  justify-content: center;
  font-family: var(--font);
}
.add-more-btn:hover { background: rgba(99,102,241,0.15); border-color: rgba(99,102,241,0.5); }

/* --- Skills Tags --- */
.skills-container {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 44px;
  padding: 10px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  align-content: flex-start;
}
.skill-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  background: rgba(99,102,241,0.12);
  border: 1px solid rgba(99,102,241,0.25);
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--text-accent);
  animation: tagPop 0.2s ease;
}
@keyframes tagPop { from{transform:scale(0.8);opacity:0} to{transform:scale(1);opacity:1} }
.skill-tag-remove {
  background: none; border: none; color: rgba(255,255,255,0.4); cursor: pointer;
  display: flex; align-items: center; padding: 0; font-size: 14px; transition: color var(--transition);
}
.skill-tag-remove:hover { color: var(--accent-danger); }

.skill-input-row { display: flex; gap: 10px; margin-top: 10px; }

/* --- File Upload --- */
.upload-zone {
  border: 2px dashed var(--glass-border);
  border-radius: var(--radius-md);
  padding: 32px;
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}
.upload-zone:hover { border-color: var(--accent-primary); background: rgba(99,102,241,0.05); }
.upload-zone.dragover { border-color: var(--accent-primary); background: rgba(99,102,241,0.1); }

.upload-zone input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }

.upload-icon { margin: 0 auto 12px; color: var(--text-muted); width: 40px; height: 40px; }
.upload-zone h3 { font-size: 0.95rem; font-weight: 600; margin-bottom: 4px; }
.upload-zone p { font-size: 0.8rem; color: var(--text-muted); }

.uploaded-file {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  background: rgba(16,185,129,0.08);
  border: 1px solid rgba(16,185,129,0.2);
  border-radius: var(--radius-md);
  margin-top: 10px;
}
.uploaded-file-icon { color: #6ee7b7; flex-shrink: 0; }
.uploaded-file-info { flex: 1; min-width: 0; }
.uploaded-file-name { font-size: 0.85rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.uploaded-file-meta { font-size: 0.75rem; color: var(--text-muted); }
.uploaded-file-actions { display: flex; gap: 6px; }

/* --- Dashboard Stats --- */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }
.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: center;
  transition: all var(--transition);
}
.stat-card:hover { border-color: rgba(99,102,241,0.3); transform: translateY(-2px); }
.stat-value { font-size: 2rem; font-weight: 800; background: var(--gradient-primary); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.stat-label { font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }

/* Progress Bar */
.progress-bar-wrap { background: rgba(255,255,255,0.06); border-radius: 10px; height: 6px; overflow: hidden; }
.progress-bar-fill { height: 100%; background: var(--gradient-primary); border-radius: 10px; transition: width 0.8s ease; }

/* --- Toast Notifications --- */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
  min-width: 260px;
  backdrop-filter: blur(20px);
}
.toast.success { background: rgba(16,185,129,0.15); border: 1px solid rgba(16,185,129,0.3); color: #6ee7b7; }
.toast.error { background: rgba(239,68,68,0.15); border: 1px solid rgba(239,68,68,0.3); color: #fca5a5; }
.toast.info { background: rgba(99,102,241,0.15); border: 1px solid rgba(99,102,241,0.3); color: #a5b4fc; }

@keyframes toastIn { from{opacity:0;transform:translateX(100%)} to{opacity:1;transform:translateX(0)} }
@keyframes toastOut { from{opacity:1;transform:translateX(0)} to{opacity:0;transform:translateX(100%)} }

/* --- Checkbox Toggle --- */
.toggle-switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.toggle-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track {
  width: 44px; height: 24px;
  background: rgba(255,255,255,0.1);
  border-radius: 12px;
  border: 1px solid var(--glass-border);
  transition: all var(--transition);
  position: relative;
}
.toggle-track::after {
  content: '';
  position: absolute;
  left: 3px; top: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: white;
  transition: transform var(--transition);
}
.toggle-switch input:checked ~ .toggle-track { background: var(--accent-primary); border-color: var(--accent-primary); }
.toggle-switch input:checked ~ .toggle-track::after { transform: translateX(20px); }

/* --- Divider --- */
.divider { height: 1px; background: var(--glass-border); margin: 8px 0; }

/* --- Scroll Custom --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* --- Save Banner --- */
.save-banner {
  position: fixed;
  bottom: 24px; left: 50%; transform: translateX(-50%);
  background: rgba(13,13,31,0.95);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  padding: 14px 24px;
  display: flex; align-items: center; gap: 16px;
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  transition: all var(--transition);
  animation: slideUp 0.3s ease;
}
.save-banner.hidden { opacity: 0; pointer-events: none; transform: translateX(-50%) translateY(20px); }
.save-banner p { font-size: 0.875rem; color: var(--text-secondary); }

/* --- Responsive --- */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid.cols-3 { grid-template-columns: 1fr; }
  .field-group.span-2 { grid-column: span 1; }
}
