/* ============================================
   SRE Interview Prep - Design System
   Premium Dark Theme with Glassmorphism
   ============================================ */

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

/* ============================================
   CSS Custom Properties (Design Tokens)
   ============================================ */
:root {
  /* Colors - Backgrounds */
  --bg-primary: #06060f;
  --bg-secondary: #0d0d1a;
  --bg-card: rgba(255, 255, 255, 0.04);
  --bg-card-hover: rgba(255, 255, 255, 0.07);
  --bg-card-active: rgba(255, 255, 255, 0.09);

  /* Colors - Accents */
  --accent-gradient: linear-gradient(135deg, #6366f1, #8b5cf6, #a78bfa);
  --accent-secondary: linear-gradient(135deg, #06b6d4, #3b82f6);
  --accent-primary: #6366f1;
  --accent-primary-light: #8b5cf6;
  --accent-primary-lighter: #a78bfa;

  /* Colors - Semantic */
  --color-success: #22c55e;
  --color-warning: #f59e0b;
  --color-error: #ef4444;
  --color-info: #3b82f6;

  /* Colors - Text */
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  /* Colors - Border */
  --border-color: rgba(255, 255, 255, 0.08);
  --border-color-hover: rgba(255, 255, 255, 0.15);
  --border-color-active: rgba(255, 255, 255, 0.2);

  /* Typography */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 1.875rem;
  --font-size-4xl: 2.25rem;
  --line-height: 1.6;
  --heading-letter-spacing: -0.02em;

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  --space-3xl: 64px;

  /* Layout */
  --sidebar-width: 260px;
  --content-max-width: 1200px;
  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 16px;
  --border-radius-xl: 24px;
  --border-radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
  --shadow-glow-strong: 0 0 30px rgba(99, 102, 241, 0.25);

  /* Transitions */
  --transition-fast: 0.15s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;

  /* Z-index layers */
  --z-bg: -1;
  --z-content: 1;
  --z-sidebar: 100;
  --z-modal: 1000;
  --z-toast: 1100;
  --z-tooltip: 1200;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: var(--line-height);
  color: var(--text-primary);
  background-color: var(--bg-primary);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ============================================
   Scrollbar Styling
   ============================================ */
::-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);
}

/* Firefox */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

/* ============================================
   Focus & Accessibility
   ============================================ */
:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
  border-radius: var(--border-radius-sm);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ============================================
   Animated Background Blob
   ============================================ */
.bg-blob {
  position: fixed;
  top: -20%;
  right: -10%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.08) 0%, rgba(139, 92, 246, 0.04) 40%, transparent 70%);
  border-radius: 50%;
  filter: blur(80px);
  animation: blobFloat 20s ease-in-out infinite;
  pointer-events: none;
  z-index: var(--z-bg);
}

.bg-blob::after {
  content: '';
  position: absolute;
  bottom: -40%;
  left: -60%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(6, 182, 212, 0.06) 0%, rgba(59, 130, 246, 0.03) 40%, transparent 70%);
  border-radius: 50%;
  filter: blur(80px);
  animation: blobFloat 25s ease-in-out infinite reverse;
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  font-weight: 700;
  letter-spacing: var(--heading-letter-spacing);
  line-height: 1.3;
  color: var(--text-primary);
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-base); }

.gradient-text {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  background-size: 200% 200%;
  animation: gradientShift 6s ease infinite;
}

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

a {
  color: var(--accent-primary-light);
  text-decoration: none;
  transition: color var(--transition-base);
}

a:hover {
  color: var(--accent-primary-lighter);
}

/* ============================================
   Sidebar Navigation
   ============================================ */
.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--sidebar-width);
  height: 100vh;
  background: rgba(13, 13, 26, 0.95);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  z-index: var(--z-sidebar);
  overflow-y: auto;
  overflow-x: hidden;
  transition: transform var(--transition-base);
}

.sidebar-header {
  padding: var(--space-lg);
  border-bottom: 1px solid var(--border-color);
  flex-shrink: 0;
}

.logo {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.logo-icon {
  font-size: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: var(--accent-gradient);
  border-radius: var(--border-radius-md);
  flex-shrink: 0;
}

.logo-title {
  font-size: var(--font-size-lg);
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: var(--heading-letter-spacing);
}

.logo-subtitle {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-top: 2px;
}

.nav-items {
  flex: 1;
  padding: var(--space-md) var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.nav-item {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-md);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  font-weight: 500;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  transition: all var(--transition-base);
  position: relative;
  text-align: left;
  width: 100%;
  border-left: 3px solid transparent;
}

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

.nav-item.active {
  color: var(--text-primary);
  background: var(--bg-card-hover);
  border-left: 3px solid;
  border-image: var(--accent-gradient) 1;
}

.nav-icon {
  font-size: var(--font-size-lg);
  width: 24px;
  text-align: center;
  flex-shrink: 0;
}

.nav-text {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-footer {
  padding: var(--space-lg);
  border-top: 1px solid var(--border-color);
  flex-shrink: 0;
}

.progress-summary {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.progress-label {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.progress-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--border-radius-full);
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: var(--border-radius-full);
  width: 0%;
  transition: width 1s ease-out;
  background-size: 200% 200%;
  animation: gradientShift 4s ease infinite;
}

.progress-text {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
}

/* ============================================
   Badge
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--border-radius-full);
  background: var(--accent-gradient);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
}

.badge:empty {
  display: none;
}

/* ============================================
   Mobile Bottom Nav
   ============================================ */
.mobile-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: rgba(13, 13, 26, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-color);
  z-index: var(--z-sidebar);
  overflow-x: auto;
  overflow-y: hidden;
}

.mobile-nav-inner {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 var(--space-sm);
  gap: var(--space-xs);
  min-width: min-content;
}

.mobile-nav .nav-item {
  flex-direction: column;
  gap: 2px;
  padding: var(--space-sm) var(--space-md);
  font-size: var(--font-size-xs);
  border-left: none;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  min-width: max-content;
  flex-shrink: 0;
}

.mobile-nav .nav-item.active {
  border-left: none;
  border-image: none;
  border-bottom: 2px solid var(--accent-primary);
  background: var(--bg-card);
}

.mobile-nav .nav-icon {
  font-size: var(--font-size-base);
}

/* ============================================
   Main Content
   ============================================ */
.main-content {
  margin-left: var(--sidebar-width);
  max-width: var(--content-max-width);
  padding: var(--space-2xl) var(--space-xl);
  min-height: 100vh;
  position: relative;
  z-index: var(--z-content);
}

/* ============================================
   Sections
   ============================================ */
.section {
  display: none;
  animation: fadeIn 0.4s ease;
}

.section.active {
  display: block;
}

.section-header {
  margin-bottom: var(--space-xl);
}

.section-title {
  font-size: var(--font-size-3xl);
  margin-bottom: var(--space-sm);
}

.section-subtitle {
  font-size: var(--font-size-base);
  color: var(--text-muted);
}

/* ============================================
   Cards - Glassmorphism
   ============================================ */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
  transition: all var(--transition-base);
}

.card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-color-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.card-header h3 {
  font-size: var(--font-size-xl);
  font-weight: 600;
}

.card-body {
  color: var(--text-secondary);
}

/* ============================================
   Match Items (JD Matching)
   ============================================ */
.match-item {
  display: flex;
  align-items: flex-start;
  gap: var(--space-md);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--border-color);
}

.match-item:last-child {
  border-bottom: none;
}

.match-indicator {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 8px;
  flex-shrink: 0;
}

.match-indicator--strong {
  background: var(--color-success);
  box-shadow: 0 0 8px rgba(34, 197, 94, 0.4);
}

.match-indicator--partial {
  background: var(--color-warning);
  box-shadow: 0 0 8px rgba(245, 158, 11, 0.4);
}

.match-indicator--gap {
  background: var(--color-error);
  box-shadow: 0 0 8px rgba(239, 68, 68, 0.4);
}

.match-content {
  flex: 1;
}

.match-title {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.match-description {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  line-height: 1.5;
}

.match-bar {
  width: 100%;
  height: 4px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--border-radius-full);
  overflow: hidden;
  margin-top: var(--space-sm);
}

.match-bar-fill {
  height: 100%;
  border-radius: var(--border-radius-full);
  animation: progressFill 1.2s ease-out forwards;
  width: 0%;
}

.match-bar-fill--strong {
  background: var(--color-success);
}

.match-bar-fill--partial {
  background: var(--color-warning);
}

.match-bar-fill--gap {
  background: var(--color-error);
}

.match-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--border-radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}

.match-status--strong {
  background: rgba(34, 197, 94, 0.12);
  color: var(--color-success);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.match-status--partial {
  background: rgba(245, 158, 11, 0.12);
  color: var(--color-warning);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.match-status--gap {
  background: rgba(239, 68, 68, 0.12);
  color: var(--color-error);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ============================================
   STAR Story Cards
   ============================================ */
.star-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  margin-bottom: var(--space-lg);
  overflow: hidden;
  transition: all var(--transition-base);
}

.star-card:hover {
  border-color: var(--border-color-hover);
  box-shadow: var(--shadow-glow);
}

.star-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-lg);
  cursor: pointer;
  transition: background var(--transition-base);
}

.star-card-header:hover {
  background: var(--bg-card-hover);
}

.star-card-title {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--text-primary);
}

.star-card-toggle {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: var(--font-size-sm);
  transition: transform var(--transition-base);
  flex-shrink: 0;
}

.star-card.expanded .star-card-toggle {
  transform: rotate(180deg);
}

.star-card-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease;
}

.star-card.expanded .star-card-body {
  max-height: 2000px;
}

.star-card-content {
  padding: 0 var(--space-lg) var(--space-lg);
}

.star-section {
  padding: var(--space-md) var(--space-lg);
  border-left: 3px solid var(--border-color);
  margin-bottom: var(--space-md);
  margin-left: var(--space-sm);
}

.star-section--situation {
  border-left-color: #6366f1;
}

.star-section--task {
  border-left-color: #06b6d4;
}

.star-section--action {
  border-left-color: #22c55e;
}

.star-section--result {
  border-left-color: #f59e0b;
}

.star-label {
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-sm);
  display: inline-block;
  padding: 2px 8px;
  border-radius: var(--border-radius-sm);
}

.star-section--situation .star-label {
  color: #6366f1;
  background: rgba(99, 102, 241, 0.1);
}

.star-section--task .star-label {
  color: #06b6d4;
  background: rgba(6, 182, 212, 0.1);
}

.star-section--action .star-label {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
}

.star-section--result .star-label {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
}

.star-section p {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: 1.7;
}

/* ============================================
   Question Flip Cards
   ============================================ */
.questions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--space-lg);
}

.question-card {
  perspective: 1000px;
  min-height: 380px;
  cursor: pointer;
}

.question-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 380px;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  transform-style: preserve-3d;
}

.question-card-inner.flipped {
  transform: rotateY(180deg);
}

.question-front,
.question-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--border-color);
  padding: var(--space-xl);
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.question-front {
  justify-content: flex-start;
  gap: var(--space-md);
}

.question-front:hover {
  border-color: var(--border-color-hover);
  box-shadow: var(--shadow-glow);
}

.question-back {
  transform: rotateY(180deg);
  overflow-y: auto;
  background: rgba(13, 13, 26, 0.95);
  justify-content: flex-start;
  gap: var(--space-md);
}

/* Category Folder Card styles */
.category-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: var(--space-xl);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition-base);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 220px;
}

.category-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-color-hover);
  transform: translateY(-5px);
  box-shadow: var(--shadow-glow);
}

.category-icon {
  font-size: 3.2rem;
  margin-bottom: var(--space-md);
  filter: drop-shadow(0 0 10px rgba(99, 102, 241, 0.3));
}

.category-name {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.category-count {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.category-progress-bar-container {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--border-radius-full);
  overflow: hidden;
  margin-top: 4px;
}

.category-progress-bar-fill {
  height: 100%;
  background: var(--accent-gradient);
  border-radius: var(--border-radius-full);
  transition: width 0.5s ease;
}

.question-text {
  font-size: var(--font-size-base);
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.6;
  flex: 1;
}

.question-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-md);
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.question-category {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--border-radius-full);
  font-size: var(--font-size-xs);
  font-weight: 500;
  background: rgba(99, 102, 241, 0.1);
  color: var(--accent-primary-lighter);
  border: 1px solid rgba(99, 102, 241, 0.15);
}

.question-flip-hint {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
}

.question-answer-title {
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--accent-primary-lighter);
  margin-bottom: var(--space-md);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.question-answer {
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  line-height: 1.7;
}

.question-answer ul {
  list-style: none;
  padding: 0;
}

.question-answer li {
  padding: var(--space-xs) 0;
  padding-left: var(--space-md);
  position: relative;
}

.question-answer li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--accent-primary-lighter);
  font-weight: 700;
}

/* ============================================
   Difficulty Badges
   ============================================ */
.difficulty {
  display: inline-flex;
  align-items: center;
  padding: 2px 10px;
  border-radius: var(--border-radius-full);
  font-size: var(--font-size-xs);
  font-weight: 600;
}

.difficulty--easy {
  background: rgba(34, 197, 94, 0.1);
  color: var(--color-success);
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.difficulty--medium {
  background: rgba(245, 158, 11, 0.1);
  color: var(--color-warning);
  border: 1px solid rgba(245, 158, 11, 0.2);
}

.difficulty--hard {
  background: rgba(239, 68, 68, 0.1);
  color: var(--color-error);
  border: 1px solid rgba(239, 68, 68, 0.2);
}

/* ============================================
   Buttons
   ============================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg);
  border: none;
  border-radius: var(--border-radius-md);
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
  text-decoration: none;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
  background-size: 200% 200%;
  animation: gradientShift 4s ease infinite;
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
  transform: translateY(-2px);
}

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

.btn-secondary:hover {
  background: var(--bg-card);
  border-color: var(--border-color-hover);
  transform: translateY(-1px);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--border-radius-sm);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: var(--font-size-lg);
  cursor: pointer;
  transition: all var(--transition-base);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-color-hover);
}

/* ============================================
   Tags
   ============================================ */
.tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 12px;
  border-radius: var(--border-radius-full);
  font-size: var(--font-size-xs);
  font-weight: 500;
  background: rgba(99, 102, 241, 0.08);
  color: var(--accent-primary-lighter);
  border: 1px solid rgba(99, 102, 241, 0.12);
  transition: all var(--transition-base);
}

.tag:hover {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.25);
}

.tag-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

/* ============================================
   Timer Display (Mock Interview)
   ============================================ */
.timer-display {
  font-size: var(--font-size-4xl);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  text-align: center;
  padding: var(--space-xl) 0;
  letter-spacing: 0.05em;
}

.timer-display.warning {
  color: var(--color-error);
  animation: timerPulse 1s ease-in-out infinite;
}

/* ============================================
   Knowledge / Reference Cards
   ============================================ */
.knowledge-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  margin-bottom: var(--space-md);
  overflow: hidden;
  transition: all var(--transition-base);
}

.knowledge-card:hover {
  border-color: var(--border-color-hover);
  box-shadow: var(--shadow-glow);
}

.knowledge-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  cursor: pointer;
  transition: background var(--transition-base);
}

.knowledge-card-header:hover {
  background: var(--bg-card-hover);
}

.knowledge-card-title {
  font-size: var(--font-size-base);
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.knowledge-card-icon {
  font-size: var(--font-size-lg);
}

.knowledge-card-toggle {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  transition: transform var(--transition-base);
}

.knowledge-card.expanded .knowledge-card-toggle {
  transform: rotate(180deg);
}

.knowledge-section {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease;
}

.knowledge-card.expanded .knowledge-section {
  max-height: 5000px;
}

.knowledge-content {
  padding: 0 var(--space-lg) var(--space-lg);
}

.knowledge-content p {
  font-size: var(--font-size-sm);
  line-height: 1.7;
  margin-bottom: var(--space-sm);
}

.knowledge-content code {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: var(--font-size-xs);
  background: rgba(255, 255, 255, 0.06);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--accent-primary-lighter);
}

.knowledge-content pre {
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  padding: var(--space-md);
  overflow-x: auto;
  margin: var(--space-md) 0;
}

.knowledge-content pre code {
  background: none;
  padding: 0;
  font-size: var(--font-size-xs);
  color: var(--text-secondary);
}

/* Category color coding for knowledge cards */
.knowledge-card[data-category="linux"] {
  border-left: 3px solid #f59e0b;
}

.knowledge-card[data-category="kubernetes"] {
  border-left: 3px solid #3b82f6;
}

.knowledge-card[data-category="monitoring"] {
  border-left: 3px solid #22c55e;
}

.knowledge-card[data-category="networking"] {
  border-left: 3px solid #06b6d4;
}

.knowledge-card[data-category="security"] {
  border-left: 3px solid #ef4444;
}

.knowledge-card[data-category="database"] {
  border-left: 3px solid #8b5cf6;
}

.knowledge-card[data-category="cicd"] {
  border-left: 3px solid #ec4899;
}

.knowledge-card[data-category="cloud"] {
  border-left: 3px solid #6366f1;
}

/* ============================================
   Progress Ring (SVG)
   ============================================ */
.progress-ring {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

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

.progress-ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.06);
}

.progress-ring-fill {
  fill: none;
  stroke: url(#accent-gradient-svg);
  stroke-linecap: round;
  transition: stroke-dashoffset 1s ease-out;
}

.progress-ring-text {
  position: absolute;
  font-size: var(--font-size-2xl);
  font-weight: 700;
  color: var(--text-primary);
}

/* ============================================
   Score Circle (Dashboard)
   ============================================ */
.score-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: var(--bg-card);
  border: 3px solid;
  border-color: var(--accent-primary);
  box-shadow: 0 0 20px rgba(99, 102, 241, 0.15);
  position: relative;
}

.score-circle-value {
  font-size: var(--font-size-3xl);
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
}

.score-circle-label {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-top: 4px;
}

/* ============================================
   Stats Grid
   ============================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
  margin-bottom: var(--space-xl);
}

.stat-card {
  background: var(--bg-card);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-lg);
  padding: var(--space-lg);
  text-align: center;
  transition: all var(--transition-base);
}

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

.stat-number {
  font-size: var(--font-size-4xl);
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1.2;
}

.stat-label {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-top: var(--space-sm);
  font-weight: 500;
}

.stat-detail {
  font-size: var(--font-size-xs);
  color: var(--text-muted);
  margin-top: var(--space-xs);
}

/* ============================================
   Filter Bar
   ============================================ */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-lg);
}

.filter-btn {
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-full);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-base);
  white-space: nowrap;
}

.filter-btn:hover {
  border-color: var(--border-color-hover);
  color: var(--text-primary);
  background: var(--bg-card);
}

.filter-btn.active {
  background: var(--accent-gradient);
  color: white;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* ============================================
   Search Input
   ============================================ */
.search-container {
  margin-bottom: var(--space-lg);
}

.search-input {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  transition: all var(--transition-base);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* ============================================
   Modal
   ============================================ */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(6, 6, 15, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-xl);
  padding: var(--space-2xl);
  max-width: 600px;
  width: 90%;
  max-height: 80vh;
  overflow-y: auto;
  transform: scale(0.9) translateY(20px);
  transition: transform var(--transition-base);
  box-shadow: var(--shadow-lg);
}

.modal.active .modal-content {
  transform: scale(1) translateY(0);
}

/* ============================================
   Toast Notifications
   ============================================ */
.toast-container {
  position: fixed;
  bottom: var(--space-lg);
  right: var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  z-index: var(--z-toast);
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-lg);
  color: var(--text-primary);
  font-size: var(--font-size-sm);
  pointer-events: auto;
  animation: slideUp 0.3s ease, fadeIn 0.3s ease;
  max-width: 360px;
}

.toast--success {
  border-left: 3px solid var(--color-success);
}

.toast--warning {
  border-left: 3px solid var(--color-warning);
}

.toast--error {
  border-left: 3px solid var(--color-error);
}

.toast--info {
  border-left: 3px solid var(--color-info);
}

/* ============================================
   Tab Group
   ============================================ */
.tab-group {
  display: flex;
  gap: var(--space-xs);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-md);
  padding: 4px;
}

.tab-btn {
  padding: var(--space-sm) var(--space-md);
  border: none;
  border-radius: var(--border-radius-sm);
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-family);
  font-size: var(--font-size-sm);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-base);
  flex: 1;
  text-align: center;
}

.tab-btn:hover {
  color: var(--text-primary);
}

.tab-btn.active {
  background: var(--accent-gradient);
  color: white;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.3);
}

/* ============================================
   Mock Interview
   ============================================ */
.mock-options {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.mock-option label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.mock-session {
  animation: fadeIn 0.4s ease;
}

.mock-question-display {
  text-align: center;
  padding: var(--space-2xl) var(--space-lg);
}

.mock-progress-text {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  margin-bottom: var(--space-md);
}

.mock-current-question {
  font-size: var(--font-size-2xl);
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.5;
  margin-bottom: var(--space-xl);
}

.mock-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

/* ============================================
   Checkbox Custom
   ============================================ */
.checkbox-custom {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  font-size: var(--font-size-sm);
  color: var(--text-secondary);
  user-select: none;
}

.checkbox-custom input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--border-color);
  border-radius: 4px;
  background: var(--bg-card);
  cursor: pointer;
  transition: all var(--transition-base);
  flex-shrink: 0;
  position: relative;
}

.checkbox-custom input[type="checkbox"]:checked {
  background: var(--accent-gradient);
  border-color: transparent;
}

.checkbox-custom input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
  font-size: 12px;
  font-weight: 700;
}

.checkbox-custom input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* ============================================
   Mastered Overlay
   ============================================ */
.mastered-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(6, 6, 15, 0.7);
  backdrop-filter: blur(2px);
  border-radius: var(--border-radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.mastered-overlay-content {
  text-align: center;
}

.mastered-overlay-icon {
  font-size: 2.5rem;
  margin-bottom: var(--space-sm);
}

.mastered-overlay-text {
  font-size: var(--font-size-sm);
  color: var(--color-success);
  font-weight: 600;
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-3xl) var(--space-lg);
  text-align: center;
}

.empty-state-icon {
  font-size: 3rem;
  margin-bottom: var(--space-md);
  opacity: 0.5;
}

.empty-state-title {
  font-size: var(--font-size-lg);
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: var(--space-sm);
}

.empty-state-text {
  font-size: var(--font-size-sm);
  color: var(--text-muted);
  max-width: 400px;
}

/* ============================================
   Tooltip
   ============================================ */
.tooltip {
  position: relative;
}

.tooltip::after {
  content: attr(data-tooltip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 12px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  font-size: var(--font-size-xs);
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-fast);
  z-index: var(--z-tooltip);
  box-shadow: var(--shadow-md);
}

.tooltip:hover::after {
  opacity: 1;
  visibility: visible;
}

/* ============================================
   Animations - Keyframes
   ============================================ */
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

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

@keyframes pulse {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
}

@keyframes gradientShift {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

@keyframes blobFloat {
  0%, 100% {
    transform: translate(0, 0) scale(1);
  }
  25% {
    transform: translate(30px, -50px) scale(1.1);
  }
  50% {
    transform: translate(-20px, 20px) scale(0.95);
  }
  75% {
    transform: translate(40px, 30px) scale(1.05);
  }
}

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

@keyframes timerPulse {
  0%, 100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.7;
    transform: scale(1.02);
  }
}

@keyframes progressFill {
  from {
    width: 0%;
  }
  to {
    width: var(--fill-width, 100%);
  }
}

/* ============================================
   Utility Animation Classes
   ============================================ */
.fade-in {
  animation: fadeIn 0.4s ease forwards;
}

.slide-up {
  animation: slideUp 0.5s ease forwards;
}

.pulse {
  animation: pulse 2s ease-in-out infinite;
}

.shimmer {
  background: linear-gradient(
    90deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.05) 50%,
    rgba(255, 255, 255, 0) 100%
  );
  background-size: 200% 100%;
  animation: shimmer 2s ease-in-out infinite;
}

/* ============================================
   Staggered animation delays for children
   ============================================ */
.stagger-children > *:nth-child(1) { animation-delay: 0.05s; }
.stagger-children > *:nth-child(2) { animation-delay: 0.1s; }
.stagger-children > *:nth-child(3) { animation-delay: 0.15s; }
.stagger-children > *:nth-child(4) { animation-delay: 0.2s; }
.stagger-children > *:nth-child(5) { animation-delay: 0.25s; }
.stagger-children > *:nth-child(6) { animation-delay: 0.3s; }
.stagger-children > *:nth-child(7) { animation-delay: 0.35s; }
.stagger-children > *:nth-child(8) { animation-delay: 0.4s; }
.stagger-children > *:nth-child(9) { animation-delay: 0.45s; }
.stagger-children > *:nth-child(10) { animation-delay: 0.5s; }

/* ============================================
   Responsive - Tablet (<1024px)
   ============================================ */
@media (max-width: 1024px) {
  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .questions-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }

  .main-content {
    padding: var(--space-xl) var(--space-lg);
  }

  .section-title {
    font-size: var(--font-size-2xl);
  }
}

/* ============================================
   Responsive - Mobile (<768px)
   ============================================ */
@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    pointer-events: none;
  }

  .sidebar.open {
    transform: translateX(0);
    pointer-events: auto;
  }

  .mobile-nav {
    display: block;
  }

  .main-content {
    margin-left: 0;
    padding: var(--space-lg) var(--space-md);
    padding-bottom: calc(64px + var(--space-lg));
  }

  .stats-grid {
    grid-template-columns: 1fr;
  }

  .questions-grid {
    grid-template-columns: 1fr;
  }

  .section-title {
    font-size: var(--font-size-xl);
  }

  .card {
    padding: var(--space-md);
  }

  .star-card-header {
    padding: var(--space-md);
  }

  .star-card-content {
    padding: 0 var(--space-md) var(--space-md);
  }

  .star-section {
    padding: var(--space-sm) var(--space-md);
  }

  .filter-bar {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: var(--space-sm);
    -webkit-overflow-scrolling: touch;
  }

  .tab-group {
    flex-wrap: wrap;
  }

  .toast-container {
    left: var(--space-md);
    right: var(--space-md);
    bottom: calc(64px + var(--space-md));
  }

  .toast {
    max-width: 100%;
  }

  .modal-content {
    padding: var(--space-lg);
    width: 95%;
  }

  .score-circle {
    width: 100px;
    height: 100px;
  }

  .score-circle-value {
    font-size: var(--font-size-2xl);
  }

  .timer-display {
    font-size: var(--font-size-3xl);
  }

  .mock-current-question {
    font-size: var(--font-size-xl);
  }

  .question-card {
    min-height: 200px;
  }

  .question-card-inner {
    min-height: 200px;
  }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
  .sidebar,
  .mobile-nav,
  .bg-blob,
  .toast-container {
    display: none !important;
  }

  .main-content {
    margin-left: 0;
    padding: 0;
  }

  .section {
    display: block !important;
    page-break-inside: avoid;
  }

  body {
    background: white;
    color: #1a1a1a;
  }

  .card {
    background: white;
    border: 1px solid #ddd;
    box-shadow: none;
  }
}
