/* resume.css - Professional, ATS-friendly, and print-optimized design */
:root {
  --primary-color: #3498db;
  --text-color: #2c3e50;
  --secondary-text: #34495e;
  --light-text: #7f8c8d;
  --bg-light: #f8f9fa;
  --bg-white: #ffffff;
}

/* Base Styles */
body {
  background: var(--bg-light);
  color: var(--text-color);
  font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, 'Roboto', sans-serif;
  margin: 0;
  padding: 10px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  box-sizing: border-box;
}

.resume-container {
  max-width: 900px;
  margin: 0 auto;
  background: var(--bg-white);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  overflow: hidden;
  width: 100%;
  box-sizing: border-box;
  word-wrap: break-word;
}

/* Header Section */
.resume-header {
  background: linear-gradient(135deg, var(--text-color) 0%, var(--secondary-text) 100%);
  color: white;
  padding: 40px;
}

.resume-header-content {
  display: flex;
  align-items: center;
  gap: 30px;
  flex-wrap: wrap;
}

.resume-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.2);
  object-fit: cover;
  flex-shrink: 0;
}

.resume-title-block {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.resume-title-block h1 {
  font-size: 2.8rem;
  font-weight: 700;
  margin: 0 0 8px;
  color: white;
  letter-spacing: -0.02em;
}

.resume-role {
  font-size: 1.3rem;
  color: #bdc3c7;
  margin-bottom: 16px;
  font-weight: 400;
}

.resume-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  font-size: 0.95rem;
  color: #ecf0f1;
  margin-bottom: 16px;
}

.resume-contact a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.2s;
}

.resume-contact a:hover {
  color: white;
  text-decoration: underline;
}

/* Content Sections */
.resume-body {
  padding: 32px 40px;
}

.resume-section {
  margin-bottom: 36px;
  position: relative;
}

.resume-section:last-child {
  margin-bottom: 0;
}

.resume-section-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 20px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--primary-color);
  position: relative;
}

.resume-section-title i {
  margin-right: 8px;
  color: var(--primary-color);
  width: 20px;
  text-align: center;
}

/* Skills Section */
.resume-skills ul {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 8px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.resume-skills li {
  padding: 4px 0 4px 28px;
  font-size: 0.95rem;
  color: var(--text-color);
  position: relative;
}

.resume-skills li i {
  position: absolute;
  left: 0;
  color: var(--primary-color);
  width: 20px;
  text-align: center;
}

/* Experience Section */
.job-entry {
  margin-bottom: 40px;
  padding: 24px;
  background: var(--bg-light);
  border-radius: 8px;
  border-left: 4px solid var(--primary-color);
  position: relative;
}

.job-title-line {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 8px;
}

.job-title-info {
  flex: 1;
  min-width: 0;
}

.companyname {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 4px;
  line-height: 1.3;
}

.jobtitle {
  font-size: 1rem;
  font-weight: 600;
  color: var(--secondary-text);
  line-height: 1.3;
}

.job-dates {
  font-size: 0.9rem;
  color: var(--light-text);
  font-weight: 500;
  white-space: nowrap;
  background: #ecf0f1;
  padding: 4px 12px;
  border-radius: 20px;
}

.job-description {
  margin-top: 16px;
  line-height: 1.7;
  color: var(--text-color);
}

.job-description ul {
  margin: 12px 0 0;
  padding-left: 20px;
}

.job-description li {
  margin-bottom: 10px;
  line-height: 1.6;
}

.job-description li::marker {
  color: var(--primary-color);
}

/* PDF Download Button */
.pdf-download-btn {
  align-self: flex-start;
}

.btn-download {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-download:hover {
  background: #2980b9;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

/* PDF Generation Specific Styles */
.resume-container {
  position: relative;
  display: block;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  min-height: 100vh;
}

.resume-header,
.resume-body,
.resume-section,
.job-entry {
  position: relative;
  display: block;
  width: 100%;
  box-sizing: border-box;
}

/* Responsive Design */
@media (min-width: 1400px) {
  body { 
    padding: 20px 40px; 
  }
  .resume-container { 
    max-width: 1000px;
  }
}

@media (min-width: 1200px) and (max-width: 1399px) {
  body { 
    padding: 15px 30px; 
  }
  .resume-container { 
    max-width: 950px;
  }
}

@media (min-width: 992px) and (max-width: 1199px) {
  .resume-container { 
    max-width: 900px;
  }
}

@media (max-width: 768px) {
  body { padding: 5px; }
  .resume-container { margin: 0; border-radius: 4px; }
  .resume-header { padding: 24px 20px 18px; }
  .resume-header-content {
    flex-direction: column;
    text-align: center;
    gap: 20px;
  }
  .resume-photo { width: 100px; height: 100px; }
  .resume-title-block h1 { font-size: 2.2rem; }
  .resume-role { font-size: 1.1rem; }
  .resume-contact {
    justify-content: center;
    flex-direction: column;
    align-items: center;
  }
  .resume-body { padding: 20px 16px; }
  .resume-section { margin-bottom: 24px; }
  .resume-section-title { font-size: 1.2rem; }
  .job-entry { padding: 16px; margin-bottom: 24px; }
  .job-title-line {
    flex-direction: column;
    align-items: flex-start;
  }
  .job-dates {
    align-self: flex-start;
    white-space: normal;
  }
}

@media (max-width: 480px) {
  .resume-title-block h1 { font-size: 1.8rem; }
  .resume-role { font-size: 1rem; }
  .resume-skills ul { grid-template-columns: 1fr; }
}

/* Print styles */
@media print {
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
  
  @page {
    margin: 0.25in;
    size: letter;
  }
  
  body {
    padding: 0;
    margin: 0;
    font-size: 11pt;
    line-height: 1.4;
    font-family: Arial, sans-serif;
    background: white !important;
    color: black !important;
  }
  
  .resume-container {
    max-width: none;
    width: 100%;
    box-shadow: none;
    border: none;
    border-radius: 0;
    margin: 0;
    padding: 0;
    background: white !important;
  }
  
  .resume-header {
    padding: 12pt 0;
    margin-bottom: 8pt;
    border-bottom: 2px solid black;
    background: white !important;
    color: black !important;
    page-break-after: avoid;
  }
  
  .resume-header-content {
    gap: 12pt;
  }
  
  .resume-photo {
    width: 50pt;
    height: 50pt;
    border: 1pt solid black;
  }
  
  .resume-title-block h1 {
    font-size: 18pt;
    margin-bottom: 2pt;
    color: black !important;
  }
  
  .resume-role {
    font-size: 12pt;
    margin-bottom: 4pt;
    color: black !important;
  }
  
  .resume-contact {
    font-size: 10pt;
    color: black !important;
  }
  
  .resume-body { 
    padding: 0;
    margin: 0;
  }
  
  .resume-section {
    margin-bottom: 8pt;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  
  .resume-section-title {
    font-size: 13pt;
    padding-bottom: 2pt;
    margin-bottom: 6pt;
    border-bottom: 1pt solid black;
    color: black !important;
    page-break-after: avoid;
  }
  
  .resume-skills ul {
    grid-template-columns: repeat(2, 1fr);
    gap: 2pt 12pt;
  }
  
  .resume-skills li {
    font-size: 10pt;
    padding: 1pt 0;
    padding-left: 0;
    color: black !important;
  }
  
  .resume-skills li i,
  .pdf-download-btn,
  .companyname img {
    display: none;
  }
  
  .job-entry {
    background: none;
    border: none;
    padding: 0;
    margin-bottom: 12pt;
    break-inside: avoid;
    page-break-inside: avoid;
  }
  
  .job-header {
    margin-bottom: 4pt;
    page-break-after: avoid;
  }
  
  .companyname { 
    font-size: 12pt;
    font-weight: bold;
    color: black !important;
  }
  
  .jobtitle { 
    font-size: 11pt;
    color: black !important;
  }
  
  .job-dates {
    font-size: 10pt;
    background: none;
    padding: 0;
    color: black !important;
  }
  
  .job-description {
    margin-top: 3pt;
    font-size: 10pt;
    line-height: 1.3;
    color: black !important;
  }
  
  .job-description ul {
    margin: 2pt 0 0 14pt;
  }
  
  .job-description li {
    margin-bottom: 2pt;
    color: black !important;
  }
  
  .job-description li::marker {
    color: black !important;
  }
  
  a { 
    text-decoration: none;
    color: black !important;
  }
  
  /* Ensure sections don't break awkwardly */
  .resume-section:nth-of-type(1),
  .resume-section:nth-of-type(2),
  .resume-section:nth-of-type(3) {
    margin-bottom: 6pt;
  }
  
  /* Compact paragraph spacing */
  .resume-section p {
    margin: 0 0 4pt 0;
    line-height: 1.3;
    font-size: 10pt;
  }
  
  .resume-section ul {
    margin: 2pt 0;
    padding-left: 12pt;
  }
  
  .resume-section li {
    margin-bottom: 1pt;
    line-height: 1.3;
  }
}
