/* ============================================
   Modern Resume - Professional & Recruiter-Friendly
   ============================================ */

/* CSS Variables - Easy theming */
:root {
  /* Primary palette - sophisticated teal/emerald */
  --color-primary: #0d9488;
  --color-primary-dark: #0f766e;
  --color-primary-light: #ccfbf1;
  
  /* Neutrals */
  --color-text: #1e293b;
  --color-text-muted: #64748b;
  --color-text-light: #94a3b8;
  
  /* Backgrounds */
  --color-bg: #f8fafc;
  --color-bg-card: #ffffff;
  --color-bg-accent: #f1f5f9;
  
  /* Borders */
  --color-border: #e2e8f0;
  --color-border-accent: rgba(13, 148, 136, 0.2);
  
  /* Typography */
  --font-primary: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  
  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;
  
  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 9999px;
  
  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
}

/* Dark mode variables - Dracula (IntelliJ-style) */
[data-theme="dark"] {
  --color-primary: #bd93f9;
  --color-primary-dark: #ff79c6;
  --color-primary-light: #44475a;
  
  --color-text: #f8f8f2;
  --color-text-muted: #6272a4;
  --color-text-light: #6272a4;
  
  --color-bg: #21222c;
  --color-bg-card: #282a36;
  --color-bg-accent: #44475a;
  
  --color-border: #44475a;
  --color-border-accent: rgba(189, 147, 249, 0.35);
  
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4), 0 4px 6px -4px rgba(0, 0, 0, 0.3);
}

/* Reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Base */
html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Keyframes: gradient rotates slowly across the viewport */
@keyframes gradient-rotate {
  from {
    transform: translate(-50%, -50%) rotate(0deg);
  }
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}

/* Subtle background gradient (decorative, full viewport, animated) */
body::before {
  content: '';
  position: fixed;
  top: 50%;
  left: 50%;
  width: 150vmax;
  height: 150vmax;
  background: linear-gradient(
    160deg,
    rgba(13, 148, 136, 0.11) 0%,
    rgba(20, 184, 166, 0.07) 25%,
    rgba(13, 148, 136, 0.05) 45%,
    rgba(15, 118, 110, 0.03) 65%,
    rgba(13, 148, 136, 0.015) 82%,
    transparent 100%
  );
  transform: translate(-50%, -50%) rotate(0deg);
  animation: gradient-rotate 45s linear infinite;
  pointer-events: none;
  z-index: 0;
}

[data-theme="dark"] body::before {
  background: linear-gradient(
    160deg,
    rgba(189, 147, 249, 0.12) 0%,
    rgba(255, 121, 198, 0.08) 25%,
    rgba(139, 233, 253, 0.05) 45%,
    rgba(189, 147, 249, 0.04) 65%,
    rgba(255, 121, 198, 0.02) 82%,
    transparent 100%
  );
}

/* Smooth theme transition */
html {
  transition: background-color 0.3s ease, color 0.3s ease;
}

body {
  transition: background-color 0.3s ease, color 0.3s ease;
}

.resume-header,
.resume-section,
.skill-tag,
.education-item,
.experience-date {
  transition: background-color 0.3s ease, border-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease;
}

/* Dark mode toggle button */
.theme-toggle {
  position: fixed;
  top: var(--space-lg);
  right: var(--space-lg);
  width: 44px;
  height: 44px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--color-bg-card);
  color: var(--color-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
  z-index: 100;
  transition: all 0.2s ease;
}

.theme-toggle:hover {
  background: var(--color-bg-accent);
  color: var(--color-primary);
}

.theme-toggle:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.theme-toggle .icon-sun,
.theme-toggle .icon-moon {
  position: absolute;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.theme-toggle .icon-moon {
  opacity: 0;
}

[data-theme="dark"] .theme-toggle .icon-sun {
  opacity: 0;
}

[data-theme="dark"] .theme-toggle .icon-moon {
  opacity: 1;
}

.container {
  max-width: 820px;
  margin: 0 auto;
  padding: var(--space-2xl) var(--space-xl);
  position: relative;
  z-index: 1;
}

/* ========== Hero Section ========== */
.hero-section {
  margin-bottom: var(--space-2xl);
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  min-height: 320px;
}

.hero-section:not(.hero-section--with-image) .hero-inner {
  grid-template-columns: 1fr;
}

.hero-visual {
  position: relative;
  min-height: 280px;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: var(--space-md) var(--space-lg);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), transparent);
  color: #fff;
  font-size: 0.9rem;
  margin: 0;
}

.hero-content {
  padding: var(--space-xl) var(--space-2xl);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.hero-section:not(.hero-section--with-image) .hero-content {
  padding: var(--space-2xl) var(--space-2xl);
  max-width: 640px;
}

.hero-avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: var(--space-md);
  border: 3px solid var(--color-primary);
  flex-shrink: 0;
}

.hero-avatar-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: white;
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero-greeting {
  font-size: 2rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-xs);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.hero-tagline {
  font-size: 1rem;
  color: var(--color-primary);
  font-weight: 600;
  margin-bottom: var(--space-md);
  letter-spacing: 0.01em;
}

.hero-intro {
  font-size: 0.95rem;
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: var(--space-lg);
}

.hero-intro p {
  margin-bottom: var(--space-sm);
}

.hero-intro p:last-child {
  margin-bottom: 0;
}

.hero-cta {
  display: inline-flex;
  align-self: flex-start;
  padding: 12px 24px;
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
  color: white !important;
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius-md);
  text-decoration: none !important;
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 2px 8px rgba(13, 148, 136, 0.35);
}

.hero-cta:hover {
  opacity: 0.95;
  transform: translateY(-1px);
  text-decoration: none !important;
}

[data-theme="dark"] .hero-cta {
  box-shadow: 0 2px 12px rgba(189, 147, 249, 0.4);
}

/* Hero responsive */
@media (max-width: 768px) {
  .hero-inner {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .hero-visual {
    min-height: 200px;
  }

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

  .hero-section:not(.hero-section--with-image) .hero-content {
    padding: var(--space-xl) var(--space-lg);
  }

  .hero-greeting {
    font-size: 1.6rem;
  }

  .hero-avatar {
    width: 60px;
    height: 60px;
    font-size: 1.25rem;
  }
}

/* ========== Header ========== */
.resume-header {
  text-align: center;
  margin-bottom: var(--space-2xl);
  padding: var(--space-xl) var(--space-lg);
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
}

.resume-name {
  font-size: 2.25rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-xs);
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.resume-title {
  font-size: 1.125rem;
  color: var(--color-primary);
  font-weight: 600;
  margin-bottom: var(--space-lg);
  letter-spacing: 0.02em;
}

.resume-contact {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: var(--space-md);
  font-size: 0.9rem;
  color: var(--color-text-muted);
}

.resume-contact .contact-item {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  text-decoration: none;
  color: var(--color-text-muted);
  transition: color 0.2s ease;
}

.resume-contact .contact-item:hover {
  color: var(--color-primary);
}

.resume-contact .contact-item svg {
  flex-shrink: 0;
  opacity: 0.8;
}

.resume-contact .contact-separator {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--color-text-light);
  opacity: 0.6;
}

/* ========== Sections ========== */
.resume-section {
  margin-bottom: var(--space-2xl);
  background: var(--color-bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
}

.section-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-lg);
  padding-bottom: var(--space-md);
  border-bottom: 2px solid var(--color-primary);
  display: inline-block;
  letter-spacing: -0.01em;
}

.section-content {
  line-height: 1.7;
}

/* ========== Experience ========== */
.experience-item {
  margin-bottom: var(--space-xl);
  padding-left: var(--space-lg);
  border-left: 3px solid var(--color-border);
  transition: border-color 0.2s ease;
}

.experience-item:last-child {
  margin-bottom: 0;
}

.experience-item:hover {
  border-left-color: var(--color-primary);
}

.experience-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-xs);
}

.experience-company {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--color-text);
}

.experience-date {
  font-size: 0.85rem;
  color: var(--color-primary);
  font-weight: 600;
  background: var(--color-primary-light);
  padding: 2px 10px;
  border-radius: var(--radius-pill);
}

.experience-position {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
}

.experience-description {
  color: var(--color-text-muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

.experience-description p {
  margin-bottom: var(--space-sm);
}

.experience-description p:last-child {
  margin-bottom: 0;
}

/* ========== Skills ========== */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: var(--space-lg);
}

.skills-group {
  margin-bottom: 0;
}

.skills-group h3 {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: var(--space-sm);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
}

.skill-tag {
  display: inline-block;
  font-size: 0.8rem;
  padding: 4px 10px;
  background: var(--color-bg-accent);
  color: var(--color-text);
  border-radius: var(--radius-sm);
  border: 1px solid var(--color-border);
  transition: all 0.2s ease;
}

.skill-tag:hover {
  background: var(--color-primary-light);
  border-color: var(--color-border-accent);
  color: var(--color-primary-dark);
}

/* Fallback for skills without tags (backward compatibility) */
.skills-group p {
  color: var(--color-text-muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ========== Education ========== */
.education-item {
  margin-bottom: var(--space-lg);
  padding: var(--space-md);
  background: var(--color-bg-accent);
  border-radius: var(--radius-md);
}

.education-item:last-child {
  margin-bottom: 0;
}

.education-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-xs);
}

.education-institution {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
}

.education-date {
  font-size: 0.85rem;
  color: var(--color-primary);
  font-weight: 600;
}

.education-degree {
  color: var(--color-text-muted);
  font-size: 0.9rem;
}

/* ========== Courses ========== */
.course-item {
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border);
}

.course-item:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

.course-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-xs);
}

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

/* ========== Links ========== */
a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--color-primary-dark);
  text-decoration: underline;
}

/* Toggle responsive position */
@media (max-width: 768px) {
  .theme-toggle {
    top: var(--space-md);
    right: var(--space-md);
    width: 40px;
    height: 40px;
  }
}

/* ========== Print Styles ========== */
@media print {
  .theme-toggle {
    display: none !important;
  }
  
  body::before {
    display: none;
  }
  
  body {
    background: white;
  }
  
  .container {
    padding: 0;
    max-width: 100%;
  }
  
  .hero-section,
  .resume-header,
  .resume-section {
    box-shadow: none;
    border: none;
  }

  .hero-section .hero-visual {
    display: none;
  }

  .hero-section .hero-inner {
    grid-template-columns: 1fr;
  }

  .hero-cta {
    display: none;
  }
  
  .resume-header {
    padding: var(--space-md) 0;
  }
  
  .resume-section {
    padding: var(--space-md) 0;
  }
  
  .experience-item {
    page-break-inside: avoid;
  }
  
  .skill-tag {
    border: 1px solid #ddd;
  }
}

/* ========== Responsive ========== */
@media (max-width: 768px) {
  .container {
    padding: var(--space-lg) var(--space-md);
  }
  
  .resume-name {
    font-size: 1.75rem;
  }
  
  .resume-title {
    font-size: 1rem;
  }
  
  .resume-contact {
    font-size: 0.85rem;
    flex-direction: column;
    gap: var(--space-sm);
  }
  
  .resume-contact .contact-separator {
    display: none;
  }
  
  .experience-header,
  .education-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .skills-grid {
    grid-template-columns: 1fr;
  }
}
