/* ============================================================
   CareerCoach AI — Design System (V2 Premium)
   Blueprint: Indigo (#4C3399) · Blå (#2C89F0) · Ljusgrå (#F4F2F7)
   Mockup influence: Light base, Card-driven layout
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Space+Grotesk:wght@400;500;600;700&family=Plus+Jakarta+Sans:wght@400;500;600;700&display=swap');

/* ─── CSS Custom Properties ─────────────────────────────── */
:root {
  --color-primary: #4C3399;
  --color-primary-dark: #3a2475;
  --color-primary-light: #6366F1;
  --color-accent: #2C89F0;
  --color-accent-dark: #1a6fd4;
  --color-bg: #F8F9FD;
  --color-surface: #FFFFFF;
  --color-text: #1a1625;
  --color-text-mid: #4a4558;
  --color-text-muted: #8a7fa0;
  --color-border: rgba(76, 51, 153, 0.08);
  --color-success: #10b981;

  --font-heading: 'Space Grotesk', sans-serif;
  --font-body: 'Inter', sans-serif;
  --font-display: 'Plus Jakarta Sans', sans-serif;

  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;

  --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 8px 32px rgba(76, 51, 153, 0.08);
  --shadow-lg: 0 16px 48px rgba(76, 51, 153, 0.12);

  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ─── Reset ─────────────────────────────────────────────── */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ─── Typography ─────────────────────────────────────────── */
h1,
h2,
h3,
h4 {
  font-family: var(--font-heading);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

/* ─── LANDING PAGE (V2 Premium) ─────────────────────────── */

.landing-body {
  background-color: var(--color-bg);
  background-image:
    radial-gradient(circle at top right, rgba(99, 102, 241, 0.08), transparent 40%),
    radial-gradient(circle at bottom left, rgba(44, 137, 240, 0.05), transparent 40%);
}

.landing-nav {
  position: sticky;
  top: 0;
  width: 100%;
  height: 80px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 5%;
  z-index: 1000;
  transition: var(--transition);
}

.landing-nav.scrolled {
  height: 64px;
  box-shadow: var(--shadow-sm);
}

.nav-links {
  display: flex;
  gap: 32px;
  align-items: center;
}

.nav-link {
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--color-text-mid);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  transition: var(--transition);
}

.nav-link:hover {
  color: var(--color-primary);
}

.hero-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 80px 5%;
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  /* Increased visual side weight */
  gap: 60px;
  align-items: center;
}

.hero-content {
  text-align: left;
}

.hero-badge-v2 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: #f0f7ff;
  border: 1px solid #e0efff;
  border-radius: 100px;
  color: var(--color-accent);
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 24px;
}

@keyframes hero-in {
  from {
    opacity: 0;
    transform: translateY(32px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.hero-title-v2 {
  font-size: clamp(3rem, 6vw, 5rem);
  font-weight: 800;
  color: var(--color-text);
  line-height: 0.95;
  margin-bottom: 24px;
}

.hero-title-v2 .accent {
  background: linear-gradient(135deg, var(--color-accent), var(--color-primary-light));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero-subtitle-v2 {
  font-size: 1.1rem;
  color: var(--color-text-mid);
  max-width: 480px;
  margin-bottom: 40px;
}

.hero-visual {
  position: relative;
  animation: hero-in 1s cubic-bezier(0.19, 1, 0.22, 1);
}

.hero-card-v2 {
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(76, 51, 153, 0.12);
  /* More prominent shadow */
  border: 1px solid rgba(76, 51, 153, 0.08);
  /* Subtle border */
  position: relative;
  width: 100%;
}

.hero-card-v2 img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-card-overlay {
  position: absolute;
  bottom: 24px;
  left: 24px;
  right: 24px;
  padding: 24px;
  background: rgba(255, 255, 255, 0.75);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.overlay-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-bottom: 8px;
}

.dot {
  width: 6px;
  height: 6px;
  background: var(--color-success);
  border-radius: 50%;
}

.hero-card-overlay p {
  font-size: 1.1rem;
  font-weight: 500;
  font-style: italic;
  color: var(--color-text);
  line-height: 1.3;
}

/* ─── Buttons ───────────────────────────────────────────── */
.btn-group {
  display: flex;
  gap: 16px;
  align-items: center;
}

.btn-primary-v2 {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--color-accent);
  color: white;
  padding: 18px 36px;
  border-radius: var(--radius-md);
  font-weight: 700;
  text-decoration: none;
  font-size: 0.9rem;
  box-shadow: 0 10px 20px rgba(44, 137, 240, 0.2);
  transition: var(--transition);
}

.btn-primary-v2:hover {
  background: var(--color-accent-dark);
  transform: translateY(-2px);
  box-shadow: 0 15px 30px rgba(44, 137, 240, 0.3);
}

.btn-outline-v2 {
  display: inline-flex;
  align-items: center;
  background: var(--color-surface);
  color: var(--color-text-mid);
  padding: 18px 36px;
  border-radius: var(--radius-md);
  font-weight: 700;
  text-decoration: none;
  font-size: 0.9rem;
  border: 1px solid var(--color-border);
  transition: var(--transition);
}

.btn-outline-v2:hover {
  background: #f8f9ff;
}

/* ─── Stats ─────────────────────────────────────────────── */
.stats-section-v2 {
  padding: 100px 5%;
}

.stats-grid-v2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  max-width: 900px;
  margin: 0 auto;
}

.stat-card-v2 {
  background: var(--color-surface);
  padding: 40px;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(76, 51, 153, 0.08);
  /* Subtle border */
  text-align: center;
  transition: var(--transition);
  box-shadow: 0 8px 32px rgba(76, 51, 153, 0.04);
  /* Subtle shadow */
}

.stat-card-v2:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.stat-value-v2 {
  font-size: 4.5rem;
  font-weight: 800;
  font-family: var(--font-heading);
  color: var(--color-accent);
  display: block;
  line-height: 1;
  margin-bottom: 8px;
}

.stat-label-v2 {
  font-size: 0.95rem;
  color: var(--color-text-mid);
  font-weight: 600;
  max-width: 240px;
  margin: 0 auto;
}

/* ─── Carousel (Knowledge Bank) ─────────────────────────── */
.knowledge-section {
  padding: 100px 5%;
  background: white;
}

.section-header-v2 {
  max-width: 1400px;
  margin: 0 auto 48px;
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
}

.section-title-v2 {
  text-transform: uppercase;
  font-size: 2.5rem;
  font-weight: 800;
}

.carousel-nav {
  display: flex;
  gap: 12px;
}

.nav-btn {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  color: #a0aec0;
}

.nav-btn:hover {
  background: #f8f9ff;
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.carousel-container {
  max-width: 1400px;
  margin: 0 auto;
  overflow: hidden;
  padding: 10px 0 40px;
}

.carousel-track {
  display: flex;
  gap: 24px;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.carousel-item {
  flex: 0 0 auto;
  width: 380px;
  max-width: 85vw;
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: 32px;
  border: 1px solid rgba(76, 51, 153, 0.12);
  /* Brighter border */
  box-shadow: 0 10px 30px rgba(76, 51, 153, 0.08);
  /* More defined shadow */
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
}

.carousel-item:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 40px rgba(76, 51, 153, 0.12);
  border-color: var(--color-primary-light);
}

.carousel-img-wrap {
  height: 240px;
  position: relative;
  overflow: hidden;
}

.carousel-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: 0.5s;
}

.carousel-item:hover .carousel-img-wrap img {
  transform: scale(1.1);
}

.carousel-item:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 20px 40px rgba(76, 51, 153, 0.15);
  border-color: var(--color-primary-light);
  cursor: pointer;
}

.carousel-tag {
  position: absolute;
  top: 20px;
  left: 20px;
  background: var(--color-primary);
  color: white;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 4px;
  letter-spacing: 0.1em;
}

.carousel-body {
  padding: 32px;
}

.carousel-body h3 {
  font-size: 1.4rem;
  text-transform: uppercase;
  margin-bottom: 24px;
  color: var(--color-text);
}

.carousel-btn {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--color-accent);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.05em;
  transition: var(--transition);
}

.carousel-btn:hover {
  gap: 12px;
}

/* ─── Podcast V2 ───────────────────────────────────────── */
.podcast-section-v2 {
  padding: 80px 5% 120px;
}

.podcast-container-v2 {
  max-width: 800px;
  margin: 0 auto;
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: 0 20px 48px rgba(76, 51, 153, 0.08);
  /* More prominent shadow */
  border: 1px solid rgba(76, 51, 153, 0.08);
  /* Subtle border */
}

.podcast-header-v2 {
  padding: 24px 32px;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  gap: 16px;
}

.podcast-brand {
  width: 44px;
  height: 44px;
  background: var(--color-text);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
}

.podcast-title-wrap h3 {
  font-size: 1rem;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--color-text);
}

.podcast-title-wrap p {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--color-text-muted);
  letter-spacing: 0.1em;
}

.player-main {
  padding: 32px;
}

.player-controls-v2 {
  display: flex;
  align-items: center;
  gap: 24px;
}

.play-pause-v2 {
  width: 64px;
  height: 64px;
  background: var(--color-accent);
  border: none;
  border-radius: 50%;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
  box-shadow: 0 8px 16px rgba(44, 137, 240, 0.2);
}

.play-pause-v2:hover {
  transform: scale(1.05);
  background: var(--color-accent-dark);
}

.progress-wrap-v2 {
  flex: 1;
}

.progress-bar-v2 {
  height: 6px;
  background: #edf2f7;
  border-radius: 3px;
  cursor: pointer;
  position: relative;
  margin-bottom: 12px;
}

.progress-fill-v2 {
  height: 100%;
  background: var(--color-accent);
  border-radius: 3px;
  width: 0%;
}

.player-time {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.4);
  font-family: monospace;
}

/* Responsive adjustment for landing */
@media (max-width: 992px) {
  .landing-content {
    grid-template-columns: 1fr;
    text-align: center;
    margin-top: 100px;
  }

  .hero-card {
    margin: 0 auto;
  }

  .hero-features {
    justify-content: center;
  }

  .landing-nav {
    padding: 0 20px;
  }
}

/* ============================================================
   INTERVIEW PAGE (interview.html)
   ============================================================ */
.app-body {
  height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  overflow: hidden;
}

/* ─── Top Bar ───────────────────────────────────────────── */
.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 60px;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
  z-index: 10;
}

.top-bar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--color-primary);
  text-decoration: none;
}

.brand-dot {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-dot svg {
  width: 14px;
  height: 14px;
  color: white;
}

.top-bar-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-success);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.6);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {

  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }

  50% {
    opacity: 0.6;
    transform: scale(0.8);
  }
}

.top-bar-actions {
  display: flex;
  gap: 8px;
}

.btn-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.btn-icon:hover {
  background: var(--color-bg);
  color: var(--color-primary);
  border-color: var(--color-primary);
}

.btn-icon svg {
  width: 16px;
  height: 16px;
}

/* ─── Main Split Layout ─────────────────────────────────── */
.main-split {
  display: flex;
  flex: 1;
  overflow: hidden;
  gap: 0;
}

/* ─── CHAT PANEL (Left) ─────────────────────────────────── */
.chat-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--color-border);
  background: var(--color-surface);
  min-width: 0;
}

.chat-header {
  padding: 16px 20px 14px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chat-header-left {
  display: flex;
  flex-direction: column;
}

/* Play button on AI messages */
.msg-play-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  padding: 3px 10px;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text-muted);
  font-family: var(--font-body);
  font-size: 0.68rem;
  border-radius: 100px;
  cursor: pointer;
  transition: var(--transition);
}

.msg-play-btn:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
  background: var(--color-primary-glow);
}

.msg-play-btn svg {
  width: 12px;
  height: 12px;
}

.chat-header h2 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 2px;
}

.chat-header p {
  font-size: 0.75rem;
  color: var(--color-text-muted);
}

/* Chat messages area */
.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
  width: 4px;
}

.chat-messages::-webkit-scrollbar-track {
  background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 2px;
}

/* Message bubbles */
.msg {
  max-width: 85%;
  animation: msg-in 0.3s cubic-bezier(0.34, 1.4, 0.64, 1) both;
}

@keyframes msg-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.msg-ai {
  align-self: flex-start;
}

.msg-user {
  align-self: flex-end;
}

.msg-bubble {
  padding: 12px 16px;
  border-radius: var(--radius-lg);
  font-size: 0.92rem;
  line-height: 1.65;
}

.msg-ai .msg-bubble {
  background: var(--color-ai-bubble);
  color: var(--color-text);
  border-bottom-left-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
}

.msg-user .msg-bubble {
  background: linear-gradient(135deg, var(--color-primary), #6b52c8);
  color: white;
  border-bottom-right-radius: var(--radius-sm);
  box-shadow: 0 4px 12px var(--color-primary-glow);
}

/* AI sender label */
.msg-ai .msg-sender {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: 5px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  gap: 5px;
}

.msg-ai .msg-sender::before {
  content: '';
  display: inline-block;
  width: 16px;
  height: 16px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  border-radius: 4px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-2 14.5v-9l6 4.5-6 4.5z'/%3E%3C/svg%3E");
  background-size: 10px;
  background-repeat: no-repeat;
  background-position: center;
}

/* Typing indicator */
.typing-indicator {
  display: none;
  align-self: flex-start;
  max-width: 85%;
}

.typing-indicator.visible {
  display: flex;
}

.typing-bubble {
  background: var(--color-ai-bubble);
  border: 1px solid var(--color-border);
  padding: 14px 18px;
  border-radius: var(--radius-lg);
  border-bottom-left-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 5px;
}

.typing-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--color-primary);
  opacity: 0.4;
  animation: typing-bounce 1.4s ease-in-out infinite;
}

.typing-dot:nth-child(2) {
  animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
  animation-delay: 0.4s;
}

@keyframes typing-bounce {

  0%,
  80%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }

  40% {
    transform: translateY(-6px);
    opacity: 1;
  }
}

/* Chat input area */
.chat-input-area {
  padding: 14px 16px;
  border-top: 1px solid var(--color-border);
  background: var(--color-surface);
}

.chat-input-wrap {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  background: var(--color-bg);
  border: 2px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 10px 12px 10px 16px;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.chat-input-wrap:focus-within {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 4px var(--color-primary-glow);
}

#chat-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: var(--font-body);
  font-size: 0.93rem;
  color: var(--color-text);
  resize: none;
  outline: none;
  max-height: 120px;
  line-height: 1.5;
}

#chat-input::placeholder {
  color: var(--color-text-muted);
}

#send-btn {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  box-shadow: 0 4px 12px var(--color-accent-glow);
}

#send-btn:hover:not(:disabled) {
  transform: scale(1.06);
  box-shadow: 0 6px 16px var(--color-accent-glow);
}

#send-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

#send-btn svg {
  width: 16px;
  height: 16px;
  color: white;
}

/* ─── CANVAS PANEL (Right) ──────────────────────────────── */

/* Voice & Media action buttons in input area */
.btn-input-action {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border: none;
  background: transparent;
  color: var(--color-text-muted);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: var(--transition);
}

.btn-input-action:hover {
  color: var(--color-primary);
  background: var(--color-primary-glow);
}

.btn-input-action:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

/* Mic listening state */
.btn-input-action.listening {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  animation: pulse-mic 1.2s ease-in-out infinite;
}

@keyframes pulse-mic {

  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.3);
  }

  50% {
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }
}

/* TTS toggle area */
.chat-input-extras {
  display: flex;
  align-items: center;
  padding: 4px 4px 0;
}

.btn-tts-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border: 1px solid var(--color-border);
  background: transparent;
  color: var(--color-text-muted);
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 500;
  border-radius: 100px;
  cursor: pointer;
  transition: var(--transition);
}

.btn-tts-toggle:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-tts-toggle.active {
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  color: white;
  border-color: transparent;
  box-shadow: 0 2px 8px var(--color-accent-glow);
}

.btn-tts-toggle.active:hover {
  opacity: 0.9;
}

.canvas-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  min-width: 0;
}

.canvas-header {
  padding: 14px 20px;
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.canvas-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.canvas-icon {
  width: 32px;
  height: 32px;
  background: linear-gradient(135deg, #f0fdf4, #dcfce7);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #bbf7d0;
}

.canvas-icon svg {
  width: 16px;
  height: 16px;
  color: #16a34a;
}

.canvas-header-left h2 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
}

.canvas-header-left p {
  font-size: 0.72rem;
  color: var(--color-text-muted);
}

.canvas-header-actions {
  display: flex;
  gap: 8px;
}

/* Canvas scroll area */
.canvas-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 24px 20px;
}

.canvas-scroll::-webkit-scrollbar {
  width: 4px;
}

.canvas-scroll::-webkit-scrollbar-track {
  background: transparent;
}

.canvas-scroll::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 2px;
}

/* CV Document */
.cv-document {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
}

/* CV Header block */
.cv-header-block {
  background: linear-gradient(135deg, var(--color-primary) 0%, #6b52c8 60%, #3066c8 100%);
  padding: 28px 28px 24px;
  color: white;
  position: relative;
  overflow: hidden;
}

.cv-header-block::after {
  content: '';
  position: absolute;
  bottom: -30px;
  right: -30px;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
}

#cv-name {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: white;
  margin-bottom: 4px;
  min-height: 1.6rem;
}

#cv-title {
  font-size: 0.9rem;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 16px;
  min-height: 1.2rem;
}

.cv-contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.cv-contact-item {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.8);
}

.cv-contact-item svg {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}

/* CV Body */
.cv-body {
  padding: 0;
}

/* CV Section */
.cv-section {
  padding: 20px 28px;
  border-bottom: 1px solid var(--color-border);
  transition: background var(--transition);
}

.cv-section:last-child {
  border-bottom: none;
}

.cv-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-heading);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 12px;
}

.cv-section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--color-border);
}

/* Canvas Tabs */
.canvas-tabs {
  display: flex;
  gap: 8px;
  padding: 12px 24px;
  background: white;
  border-bottom: 1px solid rgba(76, 51, 153, 0.08);
}

.tab-btn {
  padding: 8px 16px;
  border-radius: var(--radius-lg);
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text-light);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tab-btn:hover {
  background: var(--color-bg);
  color: var(--color-primary);
}

.tab-btn.active {
  background: rgba(76, 51, 153, 0.08);
  color: var(--color-primary);
}

/* Cover Letter Document */
.cl-document {
  background: white;
  min-height: 1000px;
  padding: 60px 80px;
  display: flex;
  flex-direction: column;
  gap: 40px;
  font-family: var(--font-body);
}

.cl-header {
  margin-bottom: 20px;
}

#cl-name {
  font-size: 24px;
  font-weight: 800;
  color: var(--color-primary);
  margin-bottom: 4px;
}

.cl-contact-info {
  font-size: 14px;
  color: var(--color-text-light);
}

.cl-text {
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  white-space: pre-wrap;
}

.cl-text p {
  margin-bottom: 1.25rem;
}

.cl-footer {
  margin-top: auto;
  font-size: 16px;
  line-height: 1.6;
}

/* Visibility Utilities */
.hidden {
  display: none !important;
}

/* Print specific styles — visa bara det aktiva dokumentet */
@media print {

  .chat-panel,
  .top-bar,
  .canvas-header,
  .canvas-tabs,
  .canvas-progress-bar {
    display: none !important;
  }

  .app-body {
    height: auto;
  }

  .main-split {
    display: block;
  }

  .canvas-panel {
    min-height: 100vh;
  }

  .canvas-scroll {
    padding: 0;
    overflow: visible;
  }

  .cv-document,
  .cl-document {
    box-shadow: none;
    border: none;
  }

  body.view-cover-letter .cv-document {
    display: none !important;
  }

  body:not(.view-cover-letter) .cl-document {
    display: none !important;
  }
}

/* PDF Export Active State */
.pdf-export-active {
  box-shadow: none !important;
  border: none !important;
  margin: 0 !important;
  padding: 40px !important;
  /* Standard print padding */
  background: white !important;
  color: black !important;
}

.pdf-export-active * {
  color: inherit !important;
}

.pdf-export-active .cv-section-title {
  color: var(--color-primary) !important;
  border-bottom: 2px solid var(--color-primary) !important;
}

/* CV content placeholder vs actual content */
.cv-placeholder {
  height: 12px;
  background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%);
  background-size: 200% 100%;
  animation: shimmer 1.8s infinite;
  border-radius: 6px;
  margin-bottom: 8px;
  opacity: 0.6;
}

.cv-placeholder:nth-child(2) {
  width: 80%;
  animation-delay: 0.2s;
}

.cv-placeholder:nth-child(3) {
  width: 65%;
  animation-delay: 0.4s;
}

@keyframes shimmer {
  0% {
    background-position: 200% 0;
  }

  100% {
    background-position: -200% 0;
  }
}

.cv-empty-hint {
  color: var(--color-text-muted);
  font-size: 0.8rem;
  font-style: italic;
  line-height: 1.6;
}

/* CV content (filled) */
.cv-summary-text {
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--color-text-mid);
}

.cv-experience-entry,
.cv-education-entry {
  margin-bottom: 14px;
  animation: entry-in 0.4s cubic-bezier(0.34, 1.4, 0.64, 1) both;
}

@keyframes entry-in {
  from {
    opacity: 0;
    transform: translateX(-8px);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.cv-entry-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 3px;
}

.cv-entry-title {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--color-text);
}

.cv-entry-period {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  white-space: nowrap;
}

.cv-entry-company,
.cv-entry-institution {
  font-size: 0.82rem;
  color: var(--color-primary);
  font-weight: 500;
  margin-bottom: 5px;
}

.cv-entry-desc {
  font-size: 0.82rem;
  color: var(--color-text-mid);
  line-height: 1.6;
}

/* Skills */
.skills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.skill-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  background: var(--color-primary-glow);
  color: var(--color-primary);
  font-size: 0.78rem;
  font-weight: 500;
  border-radius: 100px;
  border: 1px solid rgba(76, 51, 153, 0.2);
  animation: entry-in 0.35s cubic-bezier(0.34, 1.4, 0.64, 1) both;
}

/* Canvas empty state */
.canvas-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  text-align: center;
  padding: 48px 24px;
  color: var(--color-text-muted);
}

.canvas-empty-icon {
  width: 64px;
  height: 64px;
  background: linear-gradient(135deg, var(--color-primary-glow), var(--color-accent-glow));
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  border: 1px solid var(--color-border);
}

.canvas-empty-icon svg {
  width: 28px;
  height: 28px;
  color: var(--color-primary);
}

.canvas-empty-state h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text-mid);
  margin-bottom: 8px;
}

.canvas-empty-state p {
  font-size: 0.83rem;
  line-height: 1.6;
}

/* Canvas progress bar */
.canvas-progress-bar {
  height: 3px;
  background: var(--color-border);
  position: relative;
  overflow: hidden;
}

.canvas-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-accent));
  border-radius: 0 2px 2px 0;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  width: 0%;
}

/* ─── Error Toast ───────────────────────────────────────── */
.error-toast {
  display: none;
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(16px);
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  max-width: 480px;
  width: 90%;
  text-align: center;
  transition: all var(--transition);
}

.error-toast.visible {
  display: block;
  animation: toast-in 0.35s cubic-bezier(0.34, 1.4, 0.64, 1) both;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(16px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

/* ─── Responsive (tablet / mobile) ─────────────────────── */
@media (max-width: 768px) {
  .main-split {
    flex-direction: column;
  }

  .chat-panel {
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    min-height: 50vh;
  }

  .canvas-panel {
    min-height: 50vh;
  }

  .hero-card {
    padding: 36px 28px;
  }

  .top-bar {
    padding: 0 16px;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 1.7rem;
  }

  .cv-header-block {
    padding: 20px 18px 18px;
  }

  .cv-section {
    padding: 16px 18px;
  }
}