/* Modern CV Styles - Clean Markdown Version */

:root {
  --primary-color: #1a1a1a;
  --secondary-color: #4a5568;
  --accent-color: #3182ce;
  --accent-light: #e3f2fd;
  --text-light: #718096;
  --border-color: #e2e8f0;
  --background: #ffffff;
  --section-bg: #f8fafc;
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

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

body {
  font-family: var(--font-primary);
  line-height: 1.6;
  color: var(--primary-color);
  background-color: var(--background);
  font-size: 16px;
  font-weight: 400;
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem;
  background: white;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
}

/* PDF Download Button */
.pdf-download {
  text-align: center;
  margin-bottom: 3rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, var(--accent-light) 0%, #f0f9ff 100%);
  border-radius: 12px;
  border: 1px solid var(--border-color);
}

.pdf-download a {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--accent-color);
  color: white;
  padding: 12px 24px;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
  font-size: 14px;
  transition: all 0.2s ease;
  box-shadow: 0 2px 4px rgba(49, 130, 206, 0.2);
}

.pdf-download a:hover {
  background: #2c5aa0;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(49, 130, 206, 0.3);
}

/* Header Section */
h1 {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  text-align: center;
  letter-spacing: -0.025em;
}

.contact-info {
  text-align: center;
  margin-bottom: 2rem;
  color: var(--secondary-color);
  font-size: 14px;
}

.contact-info p {
  margin-bottom: 0.25rem;
}

.contact-info a {
  color: var(--accent-color);
  text-decoration: none;
  font-weight: 500;
}

.contact-info a:hover {
  text-decoration: underline;
}

/* Main Section Headers (## headers) */
h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-top: 3rem;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent-color);
  position: relative;
}

h2::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 40px;
  height: 2px;
  background: var(--accent-color);
  opacity: 0.3;
}

/* Job Entry Styling - Create unified cards with proper spacing */
h3 {
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-top: 2.5rem;  /* More space above each job */
  margin-bottom: 0;
  padding: 1.2rem 1.5rem 0.8rem 1.5rem;  /* More padding inside cards */
  border-left: 4px solid var(--accent-color);
  background: var(--section-bg);
  border-radius: 8px 8px 0 0;
}

/* Job Duration (italicized text right after h3) */
h3 + p {
  background: var(--section-bg);
  padding: 0 1.5rem 0.5rem 1.5rem;  /* Padding for breathing room */
  margin: 0;
  color: var(--text-light);
  font-style: italic;
  font-size: 0.9rem;
}

/* Job Description Paragraphs */
h3 + p + p {
  background: var(--section-bg);
  padding: 0.5rem 1.5rem;  /* Padding around description */
  margin: 0;
  color: var(--secondary-color);
  line-height: 1.6;
}

/* Additional paragraphs in job entries */
h3 ~ p {
  background: var(--section-bg);
  padding: 0.3rem 1.5rem;
  margin: 0;
  color: var(--secondary-color);
  line-height: 1.6;
}

/* Bullet Lists */
h3 ~ ul {
  background: var(--section-bg);
  padding: 0.5rem 1.5rem 0.5rem 3.5rem;  /* More padding around lists */
  margin: 0;
  list-style-type: disc;
}

/* Skills paragraphs (the last elements in job entries) */
h3 ~ p:has(strong:contains("Skills:")),
h3 ~ p:has(strong:contains("Technologies:")) {
  background: var(--section-bg);
  padding: 0.75rem 1.5rem 1.2rem 1.5rem;  /* Extra bottom padding */
  margin: 0;
  border-radius: 0 0 8px 8px;
}

/* If there's no skills/tech section, make the last paragraph rounded */
h3 ~ p:last-of-type:not(:has(strong)) {
  padding-bottom: 1.2rem;
  border-radius: 0 0 8px 8px;
}

/* If the last element is a list, make it rounded */
h3 ~ ul:last-of-type {
  padding-bottom: 1rem;
  border-radius: 0 0 8px 8px;
}

/* General list styling */
li {
  margin-bottom: 0.6rem;  /* More space between bullets */
  color: var(--secondary-color);
  line-height: 1.6;  /* Better line height */
}

li::marker {
  color: var(--accent-color);
}

/* Skills and Technologies */
p strong {
  color: var(--primary-color);
  font-weight: 600;
  display: inline-block;
  margin-top: 0.5rem;  /* Space above skill labels */
  margin-bottom: 0.3rem;
}

/* Regular paragraphs (not in job entries) */
h2 + p,
h2 ~ p:not(h3 ~ p) {
  margin-bottom: 1rem;
  color: var(--secondary-color);
  text-align: justify;
  background: transparent;
  padding: 0;
}

/* Override for regular paragraphs */
p {
  margin-bottom: 1rem;
  color: var(--secondary-color);
  text-align: justify;
}

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

a:hover {
  color: #2c5aa0;
  text-decoration: underline;
}

/* Horizontal Rules - More spacing */
hr {
  border: none;
  height: 1px;
  background: var(--border-color);
  margin: 2.5rem 0;  /* More space around separators */
}

/* Main Section Headers (## headers) - Better spacing */
h2 {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--primary-color);
  margin-top: 3.5rem;  /* More space above section headers */
  margin-bottom: 2rem;  /* More space below section headers */
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent-color);
  position: relative;
}

/* First section header (after profile) */
h2:first-of-type {
  margin-top: 2.5rem;
}

/* Profile section - better spacing */
h2:has(+ p:contains("Profile")) + p,
h1 + .contact-info + hr + h2 + p {
  font-size: 1.05rem;
  line-height: 1.7;
  text-align: justify;
  margin-bottom: 2rem;  /* More space after profile */
  padding: 1rem 0;
}

/* Profile section */
h2:first-of-type + p {
  font-size: 1.05rem;
  line-height: 1.7;
  text-align: justify;
  margin-bottom: 1.5rem;
}

/* Profile photo styling */
.profile-photo {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  object-fit: cover;
  margin: 1rem auto 1.5rem;
  display: block;
  border: 4px solid var(--accent-color);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.profile-photo:hover {
  transform: scale(1.02);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

/* Hide broken images gracefully */
.profile-photo[src=""], 
.profile-photo:not([src]),
img[alt="Vicente Muñoz"]:not([src]) {
  display: none;
}

/* Alternative: Show placeholder if image fails to load */
.profile-photo {
  background: var(--section-bg);
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path><circle cx="12" cy="7" r="4"></circle></svg>');
  background-repeat: no-repeat;
  background-position: center;
  background-size: 50%;
  color: var(--text-light);
}

/* Responsive Design */
@media (max-width: 768px) {
  body {
    padding: 1rem;
    margin: 1rem;
  }
  
  h1 {
    font-size: 2rem;
  }
  
  h3 {
    font-size: 1rem;
    padding: 0.75rem;
  }
  
  ul {
    padding: 0 0.75rem 0.75rem 2.5rem;
  }
  
  .profile-photo {
    width: 120px;
    height: 120px;
  }
}

/* Print Styles */
@media print {
  .pdf-download {
    display: none !important;
  }
  
  body {
    box-shadow: none;
    max-width: none;
    padding: 0;
    margin: 0;
  }
  
  h3 {
    background: white;
    border-left: 2px solid #000;
  }
  
  ul, p:has(strong) {
    background: white;
  }
}
