/* Modern CV Theme - Responsive Design with Dark Mode Support */

/* ============================================
   CSS Variables for Theme Colors
   ============================================ */
:root {
  /* Light Mode Colors */
  --bg-primary: #ffffff;
  --bg-secondary: #f8f9fa;
  --bg-card: #ffffff;
  --text-primary: #1a1a1a;
  --text-secondary: #4a5568;
  --text-muted: #718096;
  --border-color: #e2e8f0;
  --accent-primary: #3182ce;
  --accent-secondary: #805ad5;
  --accent-success: #38a169;
  --timeline-line: #cbd5e0;
  --timeline-dot: #3182ce;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
  
  /* Spacing */
  --container-padding: 2rem;
  --section-gap: 3rem;
}

/* Dark Mode Colors */
@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #1a202c;
    --bg-secondary: #2d3748;
    --bg-card: #2d3748;
    --text-primary: #f7fafc;
    --text-secondary: #e2e8f0;
    --text-muted: #a0aec0;
    --border-color: #4a5568;
    --accent-primary: #63b3ed;
    --accent-secondary: #b794f4;
    --accent-success: #68d391;
    --timeline-line: #4a5568;
    --timeline-dot: #63b3ed;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.3);
  }
}

body.dark-mode {
  --bg-primary: #1a202c;
  --bg-secondary: #2d3748;
  --bg-card: #2d3748;
  --text-primary: #f7fafc;
  --text-secondary: #e2e8f0;
  --text-muted: #a0aec0;
  --border-color: #4a5568;
  --accent-primary: #63b3ed;
  --accent-secondary: #b794f4;
  --accent-success: #68d391;
  --timeline-line: #4a5568;
  --timeline-dot: #63b3ed;
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.3);
}

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

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
    'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-primary);
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* ============================================
   Responsive Container
   ============================================ */
#main {
  width: 100%;
  padding: var(--container-padding);
}

#content {
  max-width: 100%;
  margin: 0 auto;
  padding: 2rem 1rem;
}

/* Responsive breakpoints */
@media (min-width: 640px) {
  #content {
    padding: 2rem;
  }
}

@media (min-width: 1024px) {
  #content {
    max-width: 1000px;
  }
}

@media (min-width: 1440px) {
  #content {
    max-width: 1200px;
  }
}

@media (min-width: 1920px) {
  #content {
    max-width: 1400px;
  }
}

@media (min-width: 2560px) {
  #content {
    max-width: 1600px;
  }
}

/* ============================================
   Header Section
   ============================================ */
.cv-header {
  text-align: center;
  padding: 3rem 0;
  margin-bottom: var(--section-gap);
  border-bottom: 2px solid var(--border-color);
}

.cv-header h1 {
  font-size: 3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  letter-spacing: -0.02em;
}

.cv-tagline {
  font-size: 1.25rem;
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  font-weight: 400;
}

.cv-contact {
  display: flex;
  justify-content: center;
  gap: 2rem;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}

.cv-contact a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--accent-primary);
  text-decoration: none;
  font-size: 1rem;
  transition: color 0.2s ease;
}

.cv-contact a:hover {
  color: var(--accent-secondary);
}

.cv-contact-icon {
  font-size: 1.25rem;
}

.cv-meta {
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ============================================
   Dark Mode Toggle
   ============================================ */
.dark-mode-toggle {
  position: fixed;
  top: 2rem;
  right: 2rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 2px solid var(--border-color);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  z-index: 1000;
}

.dark-mode-toggle:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-lg);
}

/* ============================================
   Section Styles
   ============================================ */
.cv-section {
  margin-bottom: var(--section-gap);
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.cv-section:nth-child(1) { animation-delay: 0.1s; }
.cv-section:nth-child(2) { animation-delay: 0.2s; }
.cv-section:nth-child(3) { animation-delay: 0.3s; }
.cv-section:nth-child(4) { animation-delay: 0.4s; }
.cv-section:nth-child(5) { animation-delay: 0.5s; }

.cv-section h2 {
  font-size: 2rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 3px solid var(--accent-primary);
  display: inline-block;
}

.cv-section h3 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.cv-section h4 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}

.cv-section p {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1rem;
}

/* ============================================
   Summary Section
   ============================================ */
.cv-summary {
  background: var(--bg-card);
  padding: 2rem;
  border-radius: 12px;
  border-left: 4px solid var(--accent-primary);
  box-shadow: var(--shadow-sm);
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-secondary);
}

/* ============================================
   Skills Section - Categorized Tags
   ============================================ */
.skills-category {
  margin-bottom: 2rem;
}

.skills-category h3 {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.skills-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.skill-tag {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--bg-secondary);
  color: var(--text-primary);
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
}

.skill-tag:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  background: var(--accent-primary);
  color: white;
  border-color: var(--accent-primary);
}

/* Different colors for different categories */
.skill-tag.frontend:hover { background: #3182ce; border-color: #3182ce; }
.skill-tag.backend:hover { background: #38a169; border-color: #38a169; }
.skill-tag.cloud:hover { background: #805ad5; border-color: #805ad5; }
.skill-tag.database:hover { background: #d69e2e; border-color: #d69e2e; }
.skill-tag.ml:hover { background: #e53e3e; border-color: #e53e3e; }

/* ============================================
   Timeline - Work Experience
   ============================================ */
.timeline {
  position: relative;
  padding-left: 3rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: var(--timeline-line);
}

.timeline-item {
  position: relative;
  margin-bottom: 3rem;
  padding-bottom: 2rem;
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -3.5rem;
  top: 0.5rem;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--timeline-dot);
  border: 3px solid var(--bg-primary);
  box-shadow: 0 0 0 3px var(--timeline-line);
  z-index: 1;
}

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

.timeline-company {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text-primary);
}

.timeline-role {
  font-size: 1.1rem;
  color: var(--accent-primary);
  font-weight: 600;
  margin-top: 0.25rem;
}

.timeline-date {
  font-size: 0.95rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.timeline-location {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

.timeline-content {
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.timeline-content:hover {
  box-shadow: var(--shadow-md);
  transform: translateX(5px);
}

.timeline-description {
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 1rem;
}

/* Achievements/Highlights */
.timeline-achievements {
  margin: 1.5rem 0;
}

.timeline-achievements h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.timeline-achievements ul {
  list-style: none;
  padding: 0;
}

.timeline-achievements li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.75rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.timeline-achievements li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--accent-success);
  font-weight: bold;
  font-size: 1.1rem;
}

.timeline-achievements li.highlight {
  color: var(--accent-primary);
  font-weight: 500;
}

.timeline-achievements li.highlight::before {
  content: '★';
  color: var(--accent-primary);
}

/* Projects within timeline */
.timeline-projects {
  margin-top: 1.5rem;
}

.timeline-projects h4 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.project-item {
  background: var(--bg-secondary);
  padding: 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  border-left: 3px solid var(--accent-secondary);
}

.project-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.project-description {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin-bottom: 0.75rem;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.tech-tag {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--bg-primary);
  color: var(--text-muted);
  border-radius: 12px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid var(--border-color);
}

/* ============================================
   Education Section
   ============================================ */
.education-item {
  background: var(--bg-card);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
  box-shadow: var(--shadow-sm);
}

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

.education-school {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.education-degree {
  font-size: 1rem;
  color: var(--accent-primary);
  font-weight: 600;
  margin-top: 0.25rem;
}

.education-date {
  font-size: 0.9rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.education-details {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ============================================
   Achievements & Publications
   ============================================ */
.achievement-list {
  list-style: none;
  padding: 0;
}

.achievement-item {
  background: var(--bg-card);
  padding: 1.25rem;
  border-radius: 8px;
  border-left: 4px solid var(--accent-success);
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s ease;
}

.achievement-item:hover {
  transform: translateX(5px);
  box-shadow: var(--shadow-md);
}

.achievement-item strong {
  color: var(--text-primary);
  font-weight: 600;
}

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

a:hover {
  color: var(--accent-secondary);
  text-decoration: underline;
}

strong, b {
  font-weight: 600;
  color: var(--text-primary);
}

em, i {
  font-style: italic;
}

code {
  background: var(--bg-secondary);
  padding: 0.2rem 0.4rem;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 0.9em;
  color: var(--accent-primary);
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media (max-width: 768px) {
  .cv-header h1 {
    font-size: 2rem;
  }

  .cv-tagline {
    font-size: 1rem;
  }

  .cv-contact {
    flex-direction: column;
    gap: 0.75rem;
  }

  .timeline {
    padding-left: 2rem;
  }

  .timeline-item::before {
    left: -2.4rem;
  }

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

  .dark-mode-toggle {
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    font-size: 1.2rem;
  }

  :root {
    --section-gap: 2rem;
    --container-padding: 1rem;
  }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
  body {
    background: white;
    color: black;
  }

  .dark-mode-toggle {
    display: none;
  }

  .timeline-content,
  .education-item,
  .achievement-item {
    box-shadow: none;
    border: 1px solid #ddd;
  }

  .cv-section {
    page-break-inside: avoid;
  }

  a {
    color: black;
    text-decoration: underline;
  }
}

