/* ==========================================================================
   Modern Responsive Resume Stylesheet with Dark Mode & Print Support
   ========================================================================== */

:root {
  /* Color Palette - Light Theme (Default) */
  --bg-canvas: #f8fafc;
  --bg-surface: #ffffff;
  --bg-subtle: #f1f5f9;
  --bg-badge: #e0f2fe;
  --text-badge: #0369a1;
  --border-color: #e2e8f0;
  --border-subtle: #cbd5e1;
  
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #64748b;
  
  --accent-primary: #2563eb;
  --accent-hover: #1d4ed8;
  --accent-subtle: #eff6ff;
  
  --tag-bg: #f1f5f9;
  --tag-border: #e2e8f0;
  --tag-text: #334155;
  
  --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --card-hover-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.04);
  
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  
  --transition-speed: 0.25s;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

[data-theme="dark"] {
  /* Color Palette - Dark Theme */
  --bg-canvas: #090d16;
  --bg-surface: #111827;
  --bg-subtle: #1f2937;
  --bg-badge: #0c2d48;
  --text-badge: #38bdf8;
  --border-color: #1f2937;
  --border-subtle: #374151;
  
  --text-primary: #f9fafb;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  
  --accent-primary: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-subtle: #172554;
  
  --tag-bg: #1e293b;
  --tag-border: #334155;
  --tag-text: #93c5fd;
  
  --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
  --card-hover-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

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

/* Navigation Toolbar */
.toolbar {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  background-color: rgba(248, 250, 252, 0.85);
  border-bottom: 1px solid var(--border-color);
  padding: 0.75rem 1.5rem;
  transition: background-color var(--transition-speed) ease, border-color var(--transition-speed) ease;
}

[data-theme="dark"] .toolbar {
  background-color: rgba(9, 13, 22, 0.85);
}

.toolbar-content {
  max-width: 960px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.toolbar-badges {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-full);
}

.b1-badge {
  background-color: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  font-weight: 600;
  letter-spacing: 0.03em;
}

[data-theme="dark"] .b1-badge {
  background-color: #451a03;
  color: #fcd34d;
  border-color: #78350f;
}

.status-badge {
  background-color: var(--bg-badge);
  color: var(--text-badge);
}

.status-indicator {
  width: 8px;
  height: 8px;
  background-color: #22c55e;
  border-radius: 50%;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
  animation: pulse-dot 2s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.5rem 0.95rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s ease;
  text-decoration: none;
}

.btn-secondary {
  background-color: var(--bg-surface);
  color: var(--text-secondary);
  border-color: var(--border-color);
}

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

.btn-primary {
  background-color: var(--accent-primary);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--accent-hover);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
}

/* Theme Icon switching */
.theme-icon-sun {
  display: none;
}
.theme-icon-moon {
  display: inline-block;
}
[data-theme="dark"] .theme-icon-sun {
  display: inline-block;
}
[data-theme="dark"] .theme-icon-moon {
  display: none;
}

/* Main Container */
.resume-container {
  max-width: 900px;
  margin: 2rem auto 4rem;
  padding: 0 1.5rem;
}

/* Resume Header */
.resume-header {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2.5rem;
  box-shadow: var(--card-shadow);
  margin-bottom: 2rem;
  transition: all var(--transition-speed) ease;
}

.candidate-name {
  font-size: 2.5rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  line-height: 1.1;
  margin-bottom: 0.35rem;
}

.candidate-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--accent-primary);
  margin-bottom: 0.75rem;
}

.tagline {
  font-size: 1.05rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  max-width: 720px;
}

.contact-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  border-top: 1px solid var(--border-color);
  padding-top: 1.25rem;
}

.contact-item {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.15s ease;
}

a.contact-item:hover {
  color: var(--accent-primary);
  text-decoration: underline;
}

.contact-item svg {
  color: var(--accent-primary);
  flex-shrink: 0;
}

/* Resume Sections */
.resume-section {
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2rem 2.25rem;
  box-shadow: var(--card-shadow);
  margin-bottom: 1.75rem;
  transition: all var(--transition-speed) ease;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  padding-bottom: 0.65rem;
  border-bottom: 2px solid var(--border-color);
}

.title-icon {
  font-size: 1.25rem;
}

/* Summary Text */
.summary-text p {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.75;
}

/* Experience Timeline */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  position: relative;
}

.timeline-item {
  position: relative;
  padding-left: 1.5rem;
  border-left: 2px solid var(--border-subtle);
  transition: border-color 0.2s ease;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -7px;
  top: 4px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: var(--accent-primary);
  border: 2px solid var(--bg-surface);
}

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.role-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.company-name {
  font-weight: 600;
  color: var(--accent-primary);
  font-size: 0.975rem;
}

.location-tag {
  color: var(--text-muted);
  font-size: 0.875rem;
}

.date-badge {
  font-family: var(--font-mono);
  font-size: 0.8125rem;
  font-weight: 500;
  background-color: var(--bg-subtle);
  color: var(--text-secondary);
  padding: 0.2rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}

.role-bullets {
  list-style: none;
  margin-bottom: 1rem;
}

.role-bullets li {
  position: relative;
  padding-left: 1.25rem;
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

.role-bullets li::before {
  content: '▸';
  position: absolute;
  left: 0;
  color: var(--accent-primary);
  font-size: 0.9rem;
}

/* Tag List / Pills */
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.tag {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  background-color: var(--tag-bg);
  color: var(--tag-text);
  border: 1px solid var(--tag-border);
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.tag:hover {
  border-color: var(--accent-primary);
}

/* Skills Section Grid */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.skill-category {
  background-color: var(--bg-subtle);
  padding: 1.25rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
}

.category-title {
  font-size: 0.95rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-primary);
  margin-bottom: 0.85rem;
}

/* Projects Section */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.25rem;
}

.project-card {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.project-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent-primary);
  box-shadow: var(--card-hover-shadow);
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.65rem;
}

.project-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.project-links {
  display: flex;
  gap: 0.5rem;
}

.project-links a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  transition: color 0.15s ease, background-color 0.15s ease;
}

.project-links a:hover {
  color: var(--accent-primary);
  background-color: var(--bg-surface);
}

.project-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* Education & Certifications Split */
.split-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.25rem;
}

.edu-card, .cert-card {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 1.25rem 1.5rem;
}

.edu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}

.edu-degree {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.edu-school {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--accent-primary);
  margin-bottom: 0.35rem;
}

.edu-details {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.cert-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.cert-list {
  list-style: none;
}

.cert-list li {
  position: relative;
  padding-left: 1.2rem;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.cert-list li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: #10b981;
  font-weight: bold;
}

.cert-year {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-left: 0.3rem;
}

/* Footer */
.resume-footer {
  margin-top: 3rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.65rem;
}

.resume-footer a {
  color: var(--accent-primary);
  text-decoration: none;
}

.resume-footer a:hover {
  text-decoration: underline;
}

.footer-meta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.back-to-top-btn {
  background: none;
  border: 1px solid var(--border-color);
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.back-to-top-btn:hover {
  background-color: var(--bg-surface);
  color: var(--accent-primary);
  border-color: var(--accent-primary);
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 768px) {
  .resume-container {
    padding: 0 1rem;
    margin: 1.5rem auto 3rem;
  }

  .resume-header,
  .resume-section {
    padding: 1.5rem;
  }

  .candidate-name {
    font-size: 1.95rem;
  }

  .candidate-title {
    font-size: 1.1rem;
  }

  .contact-grid {
    flex-direction: column;
    gap: 0.65rem;
  }

  .timeline-header {
    flex-direction: column;
  }

  .date-badge {
    align-self: flex-start;
  }

  .toolbar {
    padding: 0.5rem 1rem;
  }

  .theme-toggle-label {
    display: none;
  }
}

/* ==========================================================================
   Print Stylesheet (Pixel-perfect clean PDF export via Ctrl+P)
   ========================================================================== */
@media print {
  @page {
    margin: 1.2cm 1.5cm;
    size: letter portrait;
  }

  /* Reset layout for paper */
  body {
    background: #ffffff !important;
    color: #000000 !important;
    font-size: 9.5pt;
    line-height: 1.45;
  }

  /* Hide interactive / screen-only elements */
  .toolbar,
  .back-to-top-btn,
  .project-links,
  .status-badge {
    display: none !important;
  }

  .resume-container {
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .resume-header,
  .resume-section {
    border: none !important;
    box-shadow: none !important;
    padding: 0 0 1.2rem 0 !important;
    margin-bottom: 1.2rem !important;
    background: transparent !important;
    border-radius: 0 !important;
  }

  .candidate-name {
    font-size: 20pt;
    color: #000000 !important;
  }

  .candidate-title {
    font-size: 12pt;
    color: #1e3a8a !important;
  }

  .tagline {
    font-size: 9.5pt;
    color: #333333 !important;
    margin-bottom: 0.75rem;
  }

  .contact-grid {
    border-top: 1px solid #cccccc !important;
    padding-top: 0.5rem;
    gap: 0.35rem 1rem;
  }

  .contact-item {
    font-size: 8.5pt;
    color: #333333 !important;
  }

  .contact-item svg {
    display: none;
  }

  .section-title {
    font-size: 11pt;
    border-bottom: 1.5px solid #333333 !important;
    padding-bottom: 0.25rem;
    margin-bottom: 0.75rem;
    color: #000000 !important;
  }

  .title-icon {
    display: none;
  }

  /* Avoid awkward page break splits inside items */
  .timeline-item,
  .project-card,
  .edu-card,
  .cert-card {
    page-break-inside: avoid !important;
    break-inside: avoid !important;
  }

  .timeline {
    gap: 1rem;
  }

  .timeline-item {
    border-left: none !important;
    padding-left: 0 !important;
  }

  .timeline-item::before {
    display: none !important;
  }

  .role-title {
    font-size: 10pt;
    color: #000000 !important;
  }

  .company-name {
    color: #1e3a8a !important;
    font-size: 9.5pt;
  }

  .role-bullets li {
    font-size: 9pt;
    color: #222222 !important;
    margin-bottom: 0.25rem;
  }

  .tag {
    background: transparent !important;
    border: 1px solid #999999 !important;
    color: #222222 !important;
    font-size: 7.5pt;
    padding: 0.1rem 0.35rem;
  }

  .skill-category,
  .project-card,
  .edu-card,
  .cert-card {
    background: transparent !important;
    border: 1px solid #e0e0e0 !important;
    padding: 0.65rem 0.85rem !important;
  }

  .projects-grid,
  .skills-grid,
  .split-grid {
    gap: 0.75rem;
  }

  .resume-footer {
    display: none !important;
  }
}
