/* LifeLens Career AI — Premium Futuristic Theme */
:root,
[data-theme="dark"] {
  --bg-dark: #0a0b12;
  --bg-navy: #0d1020;
  --text: #f4f6fb;
  --text-secondary: #b8c0d4;
  --card-bg: rgba(26, 30, 46, 0.62);
  --card-border: rgba(130, 140, 185, 0.18);
  --input-bg: rgba(14, 17, 28, 0.85);
  --navbar-bg: rgba(10, 11, 18, 0.82);
  --accent: #8b7cf7;
  --accent-soft: rgba(139, 124, 247, 0.18);
  --gradient-btn: linear-gradient(135deg, #6b5ce7 0%, #4a7fd4 100%);
  --green: #34d399;
  --amber: #fbbf24;
  --red: #f87171;
  --nav-height: 68px;
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.28);
  --shadow-card: 0 6px 28px rgba(0, 0, 0, 0.22);
  --shadow-hover: 0 10px 36px rgba(0, 0, 0, 0.3);
  --transition: 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  --particle-color: rgba(180, 190, 255, 0.14);
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
}

[data-theme="light"] {
  --bg-dark: #f4f6fb;
  --bg-navy: #e8ecf4;
  --text: #0f1420;
  --text-secondary: #4b5568;
  --card-bg: rgba(255, 255, 255, 0.88);
  --card-border: rgba(100, 110, 140, 0.16);
  --input-bg: rgba(255, 255, 255, 0.96);
  --navbar-bg: rgba(255, 255, 255, 0.92);
  --accent: #5b4fd4;
  --accent-soft: rgba(91, 79, 212, 0.1);
  --shadow: 0 4px 20px rgba(15, 20, 40, 0.06);
  --shadow-card: 0 6px 24px rgba(15, 20, 40, 0.07);
  --shadow-hover: 0 10px 32px rgba(15, 20, 40, 0.1);
  --particle-color: rgba(91, 79, 212, 0.1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--nav-height) + 1rem);
  overflow-x: hidden;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg-dark);
  color: var(--text);
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
  max-width: 100vw;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg,
video,
canvas {
  max-width: 100%;
  height: auto;
}

.main-content,
.section,
.glass-card,
.modal,
.navbar {
  max-width: 100%;
}

/* Background */
.bg-layer {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
}

.bg-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(165deg, #050608 0%, #0a0d18 40%, #0d1228 70%, #080a14 100%);
}

[data-theme="light"] .bg-gradient {
  background: linear-gradient(165deg, #eef1f8 0%, #e4e9f4 40%, #dce3f0 70%, #f0f3fa 100%);
}

[data-theme="light"] .bg-glow-1 {
  background: rgba(107, 92, 231, 0.06);
  opacity: 0.35;
}

[data-theme="light"] .bg-glow-2 {
  background: rgba(74, 127, 212, 0.05);
  opacity: 0.35;
}

.bg-glow {
  position: absolute;
  border-radius: 50%;
  filter: blur(64px);
  opacity: 0.28;
  animation: floatGlow 14s ease-in-out infinite;
}

.bg-glow-1 {
  width: 420px;
  height: 420px;
  background: rgba(107, 92, 231, 0.12);
  top: -8%;
  left: -4%;
}

.bg-glow-2 {
  width: 360px;
  height: 360px;
  background: rgba(74, 127, 212, 0.1);
  bottom: -4%;
  right: -4%;
  animation-delay: -6s;
}

.bg-curve {
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translateX(-50%);
  width: 120%;
  height: 200px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02) 0%, transparent 100%);
  border-radius: 50%;
  filter: blur(32px);
  opacity: 0.6;
}

#particles-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

@keyframes floatGlow {
  0%, 100% { transform: translate(0, 0) scale(1); }
  50% { transform: translate(20px, -15px) scale(1.05); }
}

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  padding: 0 clamp(1rem, 3vw, 1.75rem);
  background: var(--navbar-bg);
  backdrop-filter: blur(16px) saturate(1.15);
  -webkit-backdrop-filter: blur(16px) saturate(1.15);
  border-bottom: 1px solid var(--card-border);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03);
  z-index: 1000;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 4px rgba(107, 92, 231, 0.2));
}

.logo-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.logo-text {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.02em;
  color: var(--text);
  white-space: nowrap;
}

[data-theme="light"] .logo-text {
  text-shadow: none;
}

.nav-controls {
  margin-right: 0.25rem;
}

.theme-select {
  padding: 0.5rem 0.7rem;
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.8125rem;
  cursor: pointer;
  min-width: 88px;
  transition: border-color var(--transition), background var(--transition);
}

.theme-select:hover {
  border-color: rgba(139, 124, 247, 0.35);
}

.theme-select:focus {
  outline: none;
  border-color: var(--accent);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 0.125rem;
  align-items: center;
}

.nav-link {
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.5rem 0.875rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--text);
  background: rgba(139, 124, 247, 0.08);
}

.nav-link.active {
  color: var(--text);
  background: var(--accent-soft);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  flex-shrink: 0;
}

.nav-logged-in {
  gap: 0.5rem;
}

.nav-logged-in .welcome-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  max-width: 140px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--gradient-btn);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.85rem;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.avatar-btn {
  border: 2px solid rgba(139, 124, 247, 0.45);
  padding: 0;
  cursor: pointer;
  transition: var(--transition);
  background: var(--gradient-btn);
}

.avatar-btn:hover {
  border-color: rgba(139, 124, 247, 0.55);
  transform: scale(1.03);
  box-shadow: 0 2px 10px rgba(107, 92, 231, 0.2);
}

.avatar-btn:active {
  transform: scale(0.98);
}

.avatar-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.avatar-lg {
  width: 52px;
  height: 52px;
  font-size: 1rem;
}

.avatar-xl {
  width: 88px;
  height: 88px;
  font-size: 1.5rem;
}

.profile-photo-section {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}

.profile-photo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.guidance-msg {
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  border-left: 3px solid var(--accent);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: border-color var(--transition), background var(--transition);
}

.nav-toggle:hover {
  border-color: rgba(139, 124, 247, 0.4);
  background: var(--accent-soft);
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform var(--transition), opacity var(--transition);
}

.nav-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}

.nav-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.hidden {
  display: none !important;
}

/* Main */
.main-content {
  padding-top: calc(var(--nav-height) + var(--space-xl));
  padding-bottom: 4rem;
  max-width: 1180px;
  margin: 0 auto;
  padding-left: clamp(1rem, 3vw, 1.75rem);
  padding-right: clamp(1rem, 3vw, 1.75rem);
}

.section {
  display: none;
  animation: fadeIn 0.45s ease forwards;
}

.section.active {
  display: block;
}

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

/* Glass card */
.glass-card {
  background: var(--card-bg);
  backdrop-filter: blur(18px) saturate(1.12);
  -webkit-backdrop-filter: blur(18px) saturate(1.12);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  transition: border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

/* Buttons */
.btn {
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.625rem 1.25rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition), background var(--transition), color var(--transition);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  line-height: 1.4;
  min-height: 40px;
}

.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--gradient-btn);
  color: #fff;
  box-shadow: 0 2px 12px rgba(107, 92, 231, 0.22);
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 4px 18px rgba(107, 92, 231, 0.32);
}

.btn-primary:active:not(:disabled) {
  transform: translateY(0);
  box-shadow: 0 1px 8px rgba(107, 92, 231, 0.2);
}

.btn-outline {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--card-border);
}

.btn-outline:hover:not(:disabled) {
  border-color: rgba(139, 124, 247, 0.45);
  background: var(--accent-soft);
  transform: translateY(-1px);
}

.btn-outline:active:not(:disabled) {
  transform: translateY(0);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
}

.btn-ghost:hover:not(:disabled) {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

[data-theme="light"] .btn-ghost:hover:not(:disabled) {
  background: rgba(15, 20, 40, 0.05);
}

.btn-lg {
  padding: 0.85rem 1.75rem;
  font-size: 1rem;
}

.btn-sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.8rem;
}

.btn-block {
  width: 100%;
}

/* Hero */
.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
  margin-bottom: 3rem;
  padding: 2rem 0;
}

.badge {
  display: inline-block;
  padding: 0.35rem 0.85rem;
  background: var(--accent-soft);
  border: 1px solid rgba(139, 124, 247, 0.22);
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--accent);
  margin-bottom: 1.25rem;
  letter-spacing: 0.02em;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -0.03em;
  margin-bottom: 1rem;
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 1.05rem;
  margin-bottom: 1.75rem;
  max-width: 520px;
}

.hero-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.hero-card {
  padding: 2rem;
}

.hero-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.75rem;
}

.hero-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Profile summary */
.profile-summary {
  padding: 1.75rem;
  margin-bottom: 2.5rem;
}

.profile-summary h3 {
  margin-bottom: 1.25rem;
  font-size: 1.2rem;
}

.profile-summary-top {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.profile-summary-top h3 {
  margin-bottom: 0;
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
}

.profile-field-item {
  min-width: 0;
}

.profile-grid .label,
.profile-field-item .label {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.profile-value {
  display: block;
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
}

/* Feature cards */
.feature-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.feature-card {
  padding: 1.75rem;
  cursor: pointer;
  transition: var(--transition);
}

.feature-card:hover {
  transform: translateY(-3px);
  border-color: rgba(139, 124, 247, 0.32);
  box-shadow: var(--shadow-hover);
}

.feature-icon {
  font-size: 1.75rem;
  margin-bottom: 1rem;
}

.feature-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* Page header */
.page-header {
  margin-bottom: 2rem;
}

.page-header h2 {
  font-size: 1.75rem;
  margin-bottom: 0.35rem;
}

.page-header p {
  color: var(--text-secondary);
}

.saved-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
}

/* Forms */
.search-form {
  padding: clamp(1.25rem, 3vw, 2rem);
  margin-bottom: var(--space-xl);
}

.form-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-lg);
}

.form-group {
  margin-bottom: var(--space-lg);
}

.form-group:last-child {
  margin-bottom: 0;
}

.form-group label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  margin-bottom: 0.45rem;
  color: var(--text-secondary);
  letter-spacing: 0.01em;
}

.form-group input,
.form-group select,
.select-control {
  width: 100%;
  min-height: 44px;
  padding: 0.65rem 0.95rem;
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  line-height: 1.5;
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.form-group input::placeholder {
  color: var(--text-secondary);
  opacity: 0.65;
}

.form-group input:hover,
.form-group select:hover,
.select-control:hover {
  border-color: rgba(139, 124, 247, 0.28);
}

.form-group input:focus,
.form-group select:focus,
.select-control:focus {
  outline: none;
  border-color: rgba(139, 124, 247, 0.55);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
}

.checkbox-group label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.9rem;
  color: var(--text);
  cursor: pointer;
}

.tag-input-wrap {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.tag-input-wrap input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 0.65rem 0.95rem;
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.tag-input-wrap input:focus {
  outline: none;
  border-color: rgba(139, 124, 247, 0.55);
  box-shadow: 0 0 0 2px var(--accent-soft);
}

.tags-container {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-height: 28px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.65rem;
  background: var(--accent-soft);
  border: 1px solid rgba(139, 124, 247, 0.35);
  border-radius: 50px;
  font-size: 0.8rem;
}

.tag button {
  background: none;
  border: none;
  color: var(--text-secondary);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
  padding: 0 2px;
}

.tag button:hover {
  color: var(--red);
}

.error-msg {
  display: block;
  color: var(--red);
  font-size: 0.78rem;
  margin-top: 0.35rem;
  min-height: 1em;
}

.error-msg:not(:empty) {
  margin-top: 0.35rem;
}

/* Results */
.results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.results-controls {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.select-control {
  width: auto;
  min-width: 180px;
  padding: 0.5rem 1rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  color: var(--text);
}

.view-toggle {
  display: flex;
  gap: 0.25rem;
}

.view-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--card-border);
  background: var(--input-bg);
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-size: 1.05rem;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.view-btn.active,
.view-btn:hover {
  background: var(--accent-soft);
  border-color: rgba(139, 124, 247, 0.4);
  color: var(--text);
}

[data-theme="light"] .view-btn {
  background: rgba(255, 255, 255, 0.9);
}

/* Job cards */
.jobs-list,
.jobs-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.jobs-grid.view-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.jobs-list.view-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}

.job-card {
  padding: 1.375rem 1.5rem;
  transition: transform var(--transition), border-color var(--transition), box-shadow var(--transition);
  overflow: hidden;
}

.job-card:hover {
  transform: translateY(-2px);
  border-color: rgba(139, 124, 247, 0.28);
  box-shadow: var(--shadow-hover);
}

.job-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--space-md);
  margin-bottom: 0.75rem;
}

.job-card-header > div:first-child {
  min-width: 0;
  flex: 1;
}

.job-card h4 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin-bottom: 0.35rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

.job-meta {
  color: var(--text-secondary);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
}

.match-badge {
  padding: 0.3rem 0.65rem;
  border-radius: 50px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: 0.02em;
}

.match-high { background: rgba(52, 211, 153, 0.2); color: var(--green); }
.match-mid { background: rgba(251, 191, 36, 0.2); color: var(--amber); }
.match-low { background: rgba(248, 113, 113, 0.2); color: var(--red); }

.job-why {
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0.75rem 0;
  line-height: 1.6;
}

.job-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}

.job-tag {
  padding: 0.2rem 0.5rem;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.job-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Skeleton */
.skeleton-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.skeleton-card {
  height: 180px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, rgba(40, 44, 60, 0.5) 25%, rgba(60, 65, 85, 0.6) 50%, rgba(40, 44, 60, 0.5) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border: 1px solid var(--card-border);
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Job detail */
.job-detail-section {
  animation: fadeIn 0.4s ease;
}

.job-detail {
  padding: clamp(1.25rem, 3vw, 2rem);
  margin-top: var(--space-lg);
}

.job-detail-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--card-border);
}

.job-detail-header h2 {
  font-size: 1.75rem;
  margin-bottom: 0.5rem;
}

.detail-section {
  margin-bottom: 1.75rem;
}

.detail-section h3 {
  font-size: 1rem;
  color: var(--accent);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 600;
}

.detail-section ul {
  list-style: none;
  padding-left: 0;
}

.detail-section li {
  padding: 0.4rem 0;
  padding-left: 1.25rem;
  position: relative;
  color: var(--text-secondary);
}

.detail-section li::before {
  content: '•';
  position: absolute;
  left: 0;
  color: var(--accent);
}

.pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.contact-info p {
  margin-bottom: 0.35rem;
  color: var(--text-secondary);
}

.contact-info a {
  color: var(--accent);
  text-decoration: none;
}

.contact-info a:hover {
  text-decoration: underline;
}

/* Skills results */
.skills-loading {
  text-align: center;
  padding: 3rem;
  color: var(--text-secondary);
}

.loader-spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--card-border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.skills-results {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.career-card {
  padding: 1.5rem;
}

.career-card h4 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
}

.career-match {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.75rem;
}

.career-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 0.75rem;
}

.career-card .skills-improve {
  font-size: 0.85rem;
  margin-top: 0.5rem;
}

.career-card .next-step {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--card-border);
  font-size: 0.88rem;
  color: var(--text);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 2rem;
}

.empty-state p {
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-size: 1.05rem;
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1.5rem;
  animation: fadeOverlay 0.3s ease;
}

.modal-overlay.hidden {
  display: none;
}

@keyframes fadeOverlay {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal {
  width: 100%;
  max-width: 520px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  position: relative;
  animation: modalIn 0.35s ease;
}

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

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 1.75rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
}

.modal-close:hover {
  color: var(--text);
}

.modal h2 {
  margin-bottom: 1.5rem;
  font-size: 1.5rem;
}

.auth-form .form-group {
  margin-bottom: 1rem;
}

.auth-switch {
  text-align: center;
  margin-top: 1.25rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.auth-switch a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.auth-switch a:hover {
  text-decoration: underline;
}

.form-error {
  color: var(--red);
  font-size: 0.88rem;
  margin-bottom: 1rem;
  padding: 0.5rem;
  background: rgba(248, 113, 113, 0.1);
  border-radius: var(--radius-sm);
}

.form-success {
  color: var(--green);
  font-size: 0.88rem;
  margin-bottom: 1rem;
  padding: 0.5rem;
  background: rgba(52, 211, 153, 0.1);
  border-radius: var(--radius-sm);
}

.hero-card h3,
.hero-card p {
  min-height: 1.4em;
}

.typing-cursor {
  display: inline-block;
  width: 2px;
  height: 1em;
  background: var(--accent);
  margin-left: 2px;
  vertical-align: text-bottom;
  animation: blinkCursor 0.8s step-end infinite;
}

@keyframes blinkCursor {
  50% { opacity: 0; }
}

/* Presets */
.preset-bar {
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.25rem;
}

.preset-row {
  margin-bottom: 0.75rem;
}

.preset-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.preset-hint {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-top: 0.75rem;
  min-height: 1.2em;
}

.preset-hint.success { color: var(--green); }
.preset-hint.error { color: var(--red); }

/* Job detail navigation */
.job-detail-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.job-nav-buttons {
  display: flex;
  gap: 0.5rem;
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none !important;
}

/* Profile page */
.profile-page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 1rem;
}

.profile-page {
  padding: 2rem;
  margin-bottom: 2rem;
}

.profile-fields {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}

.profile-fields .label,
.profile-fields span:not(.label) {
  display: block;
}

.profile-fields span:not(.label) {
  font-size: 1rem;
  margin-top: 0.25rem;
}

.profile-fields .profile-value {
  overflow-wrap: anywhere;
  word-break: break-word;
  min-width: 0;
}

.cv-section {
  border-top: 1px solid var(--card-border);
  padding-top: 1.5rem;
}

.cv-section h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
}

.cv-info p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}

.cv-info .cv-status {
  color: var(--green);
  font-weight: 500;
}

.cv-upload-area {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0;
}

.cv-preview {
  margin-top: 1rem;
  padding: 1rem;
  background: var(--input-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  max-height: 280px;
  overflow-y: auto;
  font-size: 0.85rem;
  color: var(--text-secondary);
  white-space: pre-wrap;
  line-height: 1.5;
}

.profile-edit-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}

.field-hint,
.password-hint {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 0.35rem;
  line-height: 1.4;
}

/* Auth modal branding */
.auth-modal-card {
  max-width: 540px;
}

.auth-modal-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  margin: -0.5rem -0.5rem 1.25rem;
  background: linear-gradient(135deg, rgba(107, 92, 231, 0.1) 0%, rgba(74, 127, 212, 0.06) 100%);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
}

.auth-logo-icon {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}

.auth-logo-icon svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(107, 92, 231, 0.18));
}

.auth-brand-name {
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--text);
  margin-bottom: 0.15rem;
}

.auth-brand-tag {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.auth-guard-msg {
  color: var(--amber);
  font-size: 0.88rem;
  margin: -0.75rem 0 1rem;
  padding: 0.5rem 0.75rem;
  background: rgba(251, 191, 36, 0.1);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(251, 191, 36, 0.25);
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
}

.toast {
  padding: 0.75rem 1.25rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.88rem;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  animation: toastIn 0.35s ease;
  pointer-events: auto;
  max-width: 320px;
}

.toast.success { border-color: rgba(52, 211, 153, 0.4); }
.toast.error { border-color: rgba(248, 113, 113, 0.4); }

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

/* ——— Responsive: Tablet (max 1024px) ——— */
@media (max-width: 1024px) {
  .hero {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
    padding: var(--space-lg) 0;
  }

  .hero-card {
    max-width: 100%;
  }

  .feature-cards {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-md);
  }

  .profile-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .jobs-grid.view-grid,
  .jobs-list.view-grid,
  .skeleton-grid,
  #saved-jobs-container.jobs-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .pros-cons {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .saved-header {
    flex-direction: column;
    align-items: stretch;
  }

  #clear-saved-btn {
    align-self: flex-start;
  }
}

/* ——— Responsive: Mobile (max 768px) ——— */
@media (max-width: 768px) {
  :root,
  [data-theme="dark"],
  [data-theme="light"] {
    --nav-height: 64px;
  }

  /* Navbar — grid layout prevents overflow */
  .navbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto auto;
    grid-template-areas:
      "brand theme auth toggle"
      "links links links links";
    align-items: center;
    gap: 0.5rem 0.5rem;
    height: auto;
    min-height: var(--nav-height);
    padding: 0.625rem 0.875rem;
  }

  .nav-left {
    grid-area: brand;
    min-width: 0;
  }

  .nav-controls {
    grid-area: theme;
    margin: 0;
  }

  .theme-select {
    min-width: 0;
    width: auto;
    max-width: 5.5rem;
    font-size: 0.75rem;
    padding: 0.45rem 0.5rem;
    min-height: 44px;
  }

  #nav-auth,
  #nav-user {
    grid-area: auth;
    justify-self: end;
  }

  #nav-auth {
    gap: 0.375rem;
    flex-wrap: nowrap;
  }

  #nav-auth .btn,
  #nav-user .btn {
    min-height: 44px;
    padding: 0.5rem 0.75rem;
    font-size: 0.8125rem;
  }

  .nav-logged-in .welcome-text {
    display: none;
  }

  .nav-toggle {
    grid-area: toggle;
    display: flex;
    justify-self: end;
  }

  .nav-links {
    grid-area: links;
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    list-style: none;
    margin: 0;
    padding: 0.5rem 0 0.25rem;
    border-top: 1px solid var(--card-border);
    gap: 0.125rem;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links li {
    width: 100%;
  }

  .nav-link {
    display: block;
    width: 100%;
    padding: 0.75rem 0.875rem;
    min-height: 44px;
    box-sizing: border-box;
    white-space: normal;
  }

  .logo-text {
    font-size: 0.875rem;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  .logo-icon {
    width: 34px;
    height: 34px;
  }

  /* Main layout */
  .main-content {
    padding-top: calc(var(--nav-height) + 1rem);
    padding-left: 1rem;
    padding-right: 1rem;
    padding-bottom: 3rem;
  }

  .page-header h2 {
    font-size: 1.5rem;
    line-height: 1.3;
  }

  .page-header p {
    font-size: 0.9375rem;
  }

  .profile-page-header {
    flex-direction: column;
    align-items: stretch;
  }

  #btn-edit-profile {
    width: 100%;
    min-height: 44px;
  }

  /* Hero & home */
  .hero {
    margin-bottom: 2rem;
    padding: 0.5rem 0;
  }

  .hero h1 {
    font-size: clamp(1.625rem, 6vw, 2rem);
  }

  .hero-subtitle {
    font-size: 1rem;
    max-width: 100%;
  }

  .hero-card {
    padding: 1.25rem;
  }

  .feature-cards {
    grid-template-columns: 1fr;
  }

  .profile-summary-top {
    flex-wrap: wrap;
  }

  .profile-grid,
  .profile-fields {
    grid-template-columns: 1fr;
  }

  .profile-field-item,
  .profile-value {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .profile-photo-section {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-md);
  }

  .profile-photo-actions {
    width: 100%;
  }

  .profile-photo-actions .btn {
    flex: 1;
    min-width: calc(50% - 0.25rem);
    min-height: 44px;
  }

  /* Forms — single column */
  .form-row,
  .form-row.preset-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .search-form,
  .profile-page,
  .preset-bar {
    padding: 1.125rem;
  }

  .form-group {
    margin-bottom: 1rem;
  }

  .form-group input,
  .form-group select,
  .select-control,
  .tag-input-wrap input {
    width: 100%;
    max-width: 100%;
    min-height: 48px;
    font-size: 16px; /* prevents iOS zoom on focus */
  }

  .checkbox-group {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.625rem;
  }

  .checkbox-group label {
    min-height: 44px;
    width: 100%;
    padding: 0.5rem 0;
  }

  .search-form > .btn-primary.btn-lg,
  #skills-form > .btn-primary.btn-lg {
    width: 100%;
    min-height: 48px;
  }

  .preset-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .preset-actions .btn {
    width: 100%;
    min-height: 44px;
  }

  /* Modals */
  .modal-overlay {
    padding: 1rem;
    align-items: center;
  }

  .modal {
    width: calc(100% - 32px);
    max-width: 100%;
    max-height: min(90vh, calc(100dvh - 2rem));
    padding: 1.25rem;
    margin: 0 auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .auth-modal-card {
    max-width: 100%;
  }

  .auth-modal-brand {
    flex-direction: row;
    flex-wrap: wrap;
    margin-left: 0;
    margin-right: 0;
    padding: 0.875rem;
  }

  .modal-close {
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .auth-form .btn-block {
    min-height: 48px;
  }

  /* Job results */
  .results-header {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-md);
  }

  .results-header h3 {
    font-size: 1.0625rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
  }

  .results-controls {
    width: 100%;
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .results-controls .select-control {
    flex: 1 1 100%;
    width: 100%;
    min-height: 44px;
  }

  .view-toggle {
    width: 100%;
    justify-content: flex-end;
  }

  .jobs-list,
  .jobs-grid,
  #saved-jobs-container,
  .skeleton-grid,
  .jobs-grid.view-grid,
  .jobs-list.view-grid {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    grid-template-columns: 1fr;
  }

  .job-card {
    width: 100%;
    max-width: 100%;
  }

  .job-card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.625rem;
  }

  .job-meta {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .job-actions {
    flex-direction: column;
    width: 100%;
  }

  .job-actions .btn {
    width: 100%;
    min-height: 44px;
  }

  /* Job detail */
  .job-detail-nav {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
  }

  .job-detail-nav > .btn {
    width: 100%;
    min-height: 44px;
  }

  .job-nav-buttons {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0.5rem;
  }

  .job-nav-buttons .btn {
    width: 100%;
    min-height: 44px;
    flex: none;
  }

  .job-detail {
    padding: 1.125rem;
    margin-top: var(--space-md);
  }

  .job-detail-header h2 {
    font-size: 1.375rem;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .job-detail-header .job-meta {
    overflow-wrap: anywhere;
  }

  .pros-cons {
    grid-template-columns: 1fr;
  }

  .contact-info a,
  .contact-info p {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  /* Skills page */
  .skills-loading {
    padding: 2rem 1rem;
  }

  .guidance-msg {
    padding: 1rem;
    font-size: 0.9rem;
  }

  /* Profile CV */
  .cv-upload-area {
    flex-direction: column;
  }

  .cv-upload-area .btn {
    width: 100%;
    min-height: 44px;
  }

  .profile-edit-actions {
    flex-direction: column;
  }

  .profile-edit-actions .btn {
    width: 100%;
    min-height: 44px;
  }

  .cv-preview {
    max-width: 100%;
  }

  /* Saved jobs */
  .saved-header #clear-saved-btn {
    width: 100%;
    min-height: 44px;
  }

  .empty-state .btn {
    width: 100%;
    max-width: 280px;
    min-height: 44px;
  }

  /* Tag inputs */
  .tag-input-wrap {
    flex-direction: column;
    align-items: stretch;
  }

  .tag-input-wrap .btn {
    width: 100%;
    min-height: 44px;
  }
}

/* ——— Responsive: Small mobile (max 480px) ——— */
@media (max-width: 480px) {
  .navbar {
    grid-template-columns: minmax(0, 1fr) auto auto;
    grid-template-areas:
      "brand toggle toggle"
      "theme auth auth"
      "links links links";
    gap: 0.5rem;
  }

  .nav-controls {
    grid-area: theme;
    justify-self: start;
  }

  #nav-auth,
  #nav-user {
    grid-area: auth;
    justify-self: end;
    width: 100%;
    justify-content: flex-end;
  }

  #nav-auth {
    flex-wrap: wrap;
    justify-content: flex-end;
  }

  #nav-auth .btn {
    flex: 1 1 auto;
    min-width: 4.5rem;
    max-width: calc(50% - 0.2rem);
  }

  .nav-toggle {
    grid-area: toggle;
  }

  .theme-select {
    max-width: 100%;
    width: 100%;
  }

  .main-content {
    padding-left: 0.875rem;
    padding-right: 0.875rem;
  }

  .hero h1 {
    font-size: 1.625rem;
  }

  .hero-cta {
    flex-direction: column;
    gap: 0.625rem;
  }

  .hero-cta .btn {
    width: 100%;
    min-height: 48px;
  }

  .feature-card {
    padding: 1.25rem;
  }

  .preset-actions {
    grid-template-columns: 1fr;
  }

  .preset-actions .btn {
    width: 100%;
  }

  .profile-photo-actions {
    flex-direction: column;
  }

  .profile-photo-actions .btn {
    width: 100%;
    min-width: 0;
  }

  .modal {
    width: calc(100% - 24px);
    padding: 1rem;
    max-height: min(92vh, calc(100dvh - 1.5rem));
  }

  .auth-modal-brand {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }

  .auth-brand-name {
    font-size: 1.05rem;
  }

  .password-hint {
    font-size: 0.75rem;
  }

  .toast-container {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
  }

  .toast {
    max-width: none;
    width: 100%;
  }

  .match-badge {
    font-size: 0.6875rem;
    padding: 0.35rem 0.55rem;
  }

  .job-tag {
    font-size: 0.7rem;
  }
}

/* ——— UI polish refinements ——— */
.page-header {
  margin-bottom: var(--space-xl);
}

.page-header p {
  line-height: 1.6;
  max-width: 42rem;
}

.hero-subtitle {
  line-height: 1.65;
}

.profile-summary {
  padding: clamp(1.25rem, 3vw, 1.75rem);
}

.guidance-msg {
  border-radius: var(--radius-sm);
  background: rgba(139, 124, 247, 0.04);
}

.empty-state {
  padding: clamp(2rem, 5vw, 3rem) clamp(1.25rem, 3vw, 2rem);
}

.empty-state p {
  line-height: 1.65;
  max-width: 36rem;
  margin-left: auto;
  margin-right: auto;
}

.modal-overlay {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}

.modal {
  box-shadow: var(--shadow-hover);
}

.preset-bar {
  padding: 1.125rem 1.375rem;
}

.checkbox-group label {
  padding: 0.35rem 0;
  line-height: 1.4;
}

.detail-section li {
  line-height: 1.55;
}

.detail-section p,
.contact-info p {
  line-height: 1.6;
}

.skills-loading {
  padding: 2.5rem var(--space-md);
}

.profile-photo-section {
  padding-bottom: 0.25rem;
}

.profile-edit-actions .btn,
.cv-upload-area .btn {
  min-height: 38px;
}

[data-theme="light"] .feature-card:hover {
  box-shadow: var(--shadow-hover);
}

[data-theme="light"] .job-card:hover {
  box-shadow: var(--shadow-hover);
}
