/**
 * CV Page Stylesheet
 * Replicates the PDF CV design
 */

/* ==================== CSS Variables ==================== */
:root {
  --cv-primary: #1a5fb4;
  --cv-text: #1a1a1a;
  --cv-text-secondary: #4a4a4a;
  --cv-bg: #ffffff;
  --cv-page-bg: #f5f5f5;
  --cv-border: #8e8e8e;
  --cv-link: #1a5fb4;
  --cv-font: 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
}

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

html {
  font-size: 16px;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

body {
  font-family: var(--cv-font);
  font-size: 11pt;
  line-height: 1.5;
  color: var(--cv-text);
  background-color: var(--cv-page-bg);
}

a {
  color: var(--cv-link);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

/* ==================== Controls (Print/Download) ==================== */
.cv-controls {
  position: fixed;
  top: 20px;
  right: 20px;
  display: flex;
  gap: 10px;
  z-index: 1000;
}

.cv-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: var(--cv-primary);
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.cv-btn:hover {
  background: #154d94;
  transform: translateY(-1px);
  text-decoration: none;
  color: white;
}

.cv-btn:active {
  transform: translateY(0);
}

.cv-btn i {
  font-size: 16px;
}

/* ==================== CV Container ==================== */
.cv-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px;
}

.cv-page {
  background: var(--cv-bg);
  padding: 50px 60px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}

/* ==================== Header ==================== */
.cv-header {
  display: flex;
  gap: 30px;
  margin-bottom: 30px;
}

.cv-photo {
  flex-shrink: 0;
}

.cv-photo img {
  width: 130px;
  height: 160px;
  object-fit: cover;
  border: 1px solid var(--cv-border);
}

.cv-header-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.cv-name {
  font-size: 26pt;
  font-weight: 700;
  color: var(--cv-text);
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.cv-title {
  font-size: 12pt;
  font-weight: 400;
  color: var(--cv-text-secondary);
  letter-spacing: 0.3px;
  margin-bottom: 16px;
}

.cv-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-bottom: 6px;
}

.contact-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10pt;
  color: var(--cv-text);
}

.contact-item i {
  color: var(--cv-primary);
  font-size: 12px;
  width: 16px;
  text-align: center;
}

.contact-item a {
  color: var(--cv-link);
}

/* ==================== Sections ==================== */
.cv-section {
  margin-bottom: 24px;
}

.cv-section-title {
  font-size: 14pt;
  font-weight: 600;
  color: var(--cv-primary);
  padding-bottom: 6px;
  border-bottom: 1.5px solid var(--cv-border);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.cv-section-title i {
  font-size: 14px;
  width: 18px;
}

.cv-text {
  font-size: 10.5pt;
  line-height: 1.6;
  color: var(--cv-text);
  text-align: justify;
  margin-bottom: 8px;
}

.cv-text:last-child {
  margin-bottom: 0;
}

.cv-subsection-title {
  font-size: 11pt;
  font-weight: 600;
  color: var(--cv-text);
  margin: 16px 0 10px 0;
}

.cv-subsection-title:first-of-type {
  margin-top: 0;
}

/* ==================== Research Highlights ==================== */
.cv-highlights {
  display: flex;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 10px;
}

.highlight-item {
  flex: 1;
  text-align: center;
  padding: 12px 10px;
  background: linear-gradient(135deg, rgba(26, 95, 180, 0.08) 0%, rgba(26, 95, 180, 0.03) 100%);
  border-radius: 6px;
  border: 1px solid rgba(26, 95, 180, 0.15);
}

.highlight-number {
  display: block;
  font-size: 20pt;
  font-weight: 700;
  color: var(--cv-primary);
  line-height: 1.2;
}

.highlight-label {
  display: block;
  font-size: 9pt;
  color: var(--cv-text-secondary);
  margin-top: 2px;
}

/* ==================== Entries (Employment, Education, Training) ==================== */
.cv-entry {
  margin-bottom: 14px;
}

.cv-entry:last-child {
  margin-bottom: 0;
}

.cv-entry-header {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.cv-entry-title {
  font-size: 11pt;
  font-weight: 600;
  color: var(--cv-text);
}

.cv-entry-date {
  font-size: 10pt;
  font-weight: 400;
  color: var(--cv-text-secondary);
  margin-left: auto;
}

.cv-entry-place {
  font-size: 10pt;
  color: var(--cv-text-secondary);
  font-style: italic;
  margin-bottom: 4px;
}

.cv-list {
  list-style: disc;
  padding-left: 24px;
  margin: 0;
}

.cv-list li {
  font-size: 10.5pt;
  color: var(--cv-text);
  margin-bottom: 2px;
  line-height: 1.5;
}

.cv-list li:last-child {
  margin-bottom: 0;
}

.cv-list em {
  font-style: italic;
  text-decoration: underline;
  color: var(--cv-link);
}

/* ==================== Technical Skills ==================== */
.cv-skills {
  font-size: 10.5pt;
}

.cv-skill-row {
  margin-bottom: 6px;
  line-height: 1.5;
}

.cv-skill-row:last-child {
  margin-bottom: 0;
}

.skill-category {
  font-weight: 600;
  color: var(--cv-text);
}

.skill-category::after {
  content: ": ";
}

.skill-items {
  color: var(--cv-text);
}

/* ==================== Publications ==================== */
.cv-publication-legend {
  font-size: 10pt;
  color: var(--cv-text-secondary);
  text-align: center;
  margin-bottom: 14px;
}

.cv-publication-legend span {
  margin: 0 10px;
}

.cv-publication {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 10.5pt;
  line-height: 1.5;
}

.cv-publication:last-child {
  margin-bottom: 0;
}

.pub-tag {
  font-weight: 700;
  color: var(--cv-text);
  flex-shrink: 0;
}

.pub-text {
  color: var(--cv-text);
  text-align: justify;
}

.pub-text em {
  font-style: italic;
}

.pub-link {
  color: var(--cv-primary);
  margin-left: 4px;
  font-size: 10pt;
  transition: color 0.2s ease;
}

.pub-link:hover {
  color: #154d94;
}

.pub-link i {
  vertical-align: baseline;
}

/* ==================== Languages ==================== */
.cv-languages {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 40px;
  max-width: 500px;
}

.language-item {
  display: flex;
  gap: 20px;
}

.language-name {
  font-weight: 700;
  color: var(--cv-text);
  font-size: 10.5pt;
  min-width: 80px;
}

.language-level {
  font-size: 10.5pt;
  color: var(--cv-text);
}

/* ==================== Responsive ==================== */
@media screen and (max-width: 768px) {
  .cv-controls {
    position: static;
    justify-content: center;
    padding: 15px;
    background: var(--cv-bg);
    margin-bottom: 0;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  }

  .cv-container {
    padding: 20px 10px;
  }

  .cv-page {
    padding: 30px 25px;
    border-radius: 0;
  }

  .cv-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 20px;
  }

  .cv-name {
    font-size: 20pt;
  }

  .cv-title {
    font-size: 11pt;
  }

  .cv-contact {
    justify-content: center;
  }

  .cv-section-title {
    font-size: 13pt;
  }

  .cv-text {
    text-align: left;
  }

  .skill-category {
    width: 140px;
    font-size: 10pt;
    padding-right: 12px;
  }

  .skill-items {
    font-size: 10pt;
  }

  .cv-languages {
    grid-template-columns: 1fr;
  }

  .pub-text {
    text-align: left;
  }

  .cv-publication-legend {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }

  .cv-publication-legend span {
    margin: 0;
  }

  .cv-highlights {
    flex-wrap: wrap;
  }

  .highlight-item {
    min-width: calc(50% - 10px);
  }

  .highlight-number {
    font-size: 18pt;
  }
}

@media screen and (max-width: 480px) {
  .cv-btn span {
    display: none;
  }

  .cv-btn {
    padding: 10px 12px;
  }

  .cv-page {
    padding: 20px 15px;
  }

  .cv-photo img {
    width: 100px;
    height: 125px;
  }

  .cv-name {
    font-size: 18pt;
  }

  .cv-entry-header {
    flex-direction: column;
    gap: 2px;
  }
}

/* ==================== Print Styles ==================== */
@media print {
  @page {
    size: A4 portrait;
    margin: 12mm 12mm 12mm 12mm;
  }

  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }

  html {
    font-size: 10px;
  }

  body {
    background: white;
    margin: 0;
    padding: 0;
    width: 210mm;
  }

  .no-print {
    display: none !important;
  }

  .cv-container {
    max-width: 210mm;
    width: 100%;
    padding: 0;
    margin: 0;
  }

  .cv-page {
    box-shadow: none;
    padding: 0;
    border-radius: 0;
    width: 100%;
  }

  .cv-header {
    margin-bottom: 20px;
  }

  .cv-section {
    margin-bottom: 16px;
  }

  .cv-section-title {
    color: var(--cv-primary) !important;
    font-size: 12pt;
    margin-bottom: 10px;
  }

  .cv-subsection-title {
    font-size: 10pt;
    margin: 12px 0 8px 0;
  }

  .cv-entry {
    page-break-inside: avoid;
    margin-bottom: 10px;
  }

  .cv-publication {
    page-break-inside: avoid;
    margin-bottom: 8px;
    font-size: 9pt;
  }

  .cv-skill-row {
    margin-bottom: 4px;
    font-size: 9.5pt;
  }

  .contact-item i {
    color: var(--cv-primary) !important;
  }

  a {
    color: var(--cv-link) !important;
    text-decoration: none;
  }

  .cv-name {
    font-size: 22pt;
  }

  .cv-title {
    font-size: 11pt;
  }

  .cv-photo img {
    width: 110px;
    height: 135px;
  }

  .cv-section-title i {
    color: var(--cv-primary) !important;
  }

  .cv-highlights {
    gap: 10px;
  }

  .highlight-item {
    padding: 8px 6px;
    background: rgba(26, 95, 180, 0.05) !important;
    border-color: rgba(26, 95, 180, 0.2) !important;
  }

  .highlight-number {
    font-size: 16pt;
    color: var(--cv-primary) !important;
  }

  .highlight-label {
    font-size: 8pt;
  }

  .cv-entry-place {
    font-size: 9pt;
  }

  .cv-list li {
    font-size: 9pt;
  }

  .cv-text {
    font-size: 9.5pt;
  }
}
