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

:root {
  --primary:       #1b3a5c;
  --accent:        #2d7dd2;
  --accent-light:  #dbeafe;
  --accent-muted:  #93c5fd;
  --text:          #1a202c;
  --text-muted:    #64748b;
  --border:        #e2e8f0;
  --bg:            #ffffff;
  --sidebar-bg:    #f1f5f9;
  --card-bg:       #f8fafc;
  --badge-bg:      #dbeafe;
  --badge-color:   #1d4ed8;
  --green:         #059669;
  --green-light:   #d1fae5;
}

html { font-size: 14px; }

body {
  font-family: 'Inter', 'Segoe UI', sans-serif;
  color: var(--text);
  background: #e8ecf0;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

/* ===================== PAGE WRAPPER ===================== */
.cv-page {
  max-width: 1080px;
  margin: 2rem auto;
  background: var(--bg);
  box-shadow: 0 4px 40px rgba(0,0,0,0.18);
  border-radius: 4px;
  overflow: hidden;
}

/* ===================== HEADER ===================== */
.cv-header {
  background: linear-gradient(135deg, #1b3a5c 0%, #2d5f99 55%, #1a9d82 100%);
  color: #fff;
  padding: 2.2rem 3rem;
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.header-photo img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid rgba(255,255,255,0.35);
  box-shadow: 0 4px 24px rgba(0,0,0,0.35);
  flex-shrink: 0;
}

.header-info { flex: 1; }

.header-info h1 {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 2rem;
  font-weight: 400;
  letter-spacing: -0.5px;
  line-height: 1.15;
  margin-bottom: 0.3rem;
}

.header-info h1 strong { font-weight: 700; }

.header-profile {
  font-size: 0.95rem;
  opacity: 0.82;
  margin-bottom: 1.1rem;
  font-weight: 300;
  letter-spacing: 0.2px;
}

.header-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.contact-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: rgba(255,255,255,0.14);
  border: 1px solid rgba(255,255,255,0.28);
  border-radius: 20px;
  padding: 0.3rem 0.8rem 0.3rem 0.65rem;
  font-size: 0.78rem;
  color: #fff;
  text-decoration: none;
  transition: background 0.15s, border-color 0.15s;
}

a.contact-chip:hover {
  background: rgba(255,255,255,0.26);
  border-color: rgba(255,255,255,0.5);
}

.contact-chip i {
  font-size: 0.85rem;
  width: 16px;
  text-align: center;
  opacity: 0.95;
  flex-shrink: 0;
}

.contact-chip-text {
  font-size: 0.78rem;
}

/* ===================== BODY GRID ===================== */
.cv-body {
  display: grid;
  grid-template-columns: 1fr 280px;
}

/* ===================== LEFT COLUMN ===================== */
.cv-left {
  padding: 2.2rem 2.5rem 2.2rem 3rem;
  border-right: 1px solid var(--border);
}

.cv-section { margin-bottom: 2.5rem; }

.section-title {
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 1.4rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--accent-light);
}

.section-title i {
  color: var(--accent);
  font-size: 0.85rem;
}

/* ===================== TIMELINE ===================== */
.timeline {
  position: relative;
  padding-left: 1.6rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 6px;
  bottom: 12px;
  width: 2px;
  background: linear-gradient(to bottom, var(--accent) 0%, var(--border) 100%);
}

.timeline-item {
  position: relative;
  margin-bottom: 1.8rem;
}

.timeline-dot {
  position: absolute;
  left: -1.6rem;
  top: 7px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg);
  box-shadow: 0 0 0 2px var(--accent);
  z-index: 1;
}

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

.company-name {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--primary);
}

.employer-logo {
  display: inline-block;
  height: 18px;
  width: auto;
  vertical-align: middle;
  margin-right: 0.45rem;
  opacity: 0.8;
  position: relative;
  top: -1px;
}

.company-place {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.company-place i { font-size: 0.68rem; }

.position {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 0 6px 6px 0;
  padding: 0.9rem 1.1rem;
  margin-bottom: 0.6rem;
}

.position-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.5rem;
}

.position-title {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.date-badge {
  font-size: 0.7rem;
  background: var(--accent-light);
  color: var(--accent);
  border-radius: 12px;
  padding: 0.18rem 0.65rem;
  white-space: nowrap;
  font-weight: 500;
  flex-shrink: 0;
}

.position-details {
  list-style: none;
  margin-bottom: 0.65rem;
}

.position-details li {
  font-size: 0.81rem;
  color: var(--text-muted);
  padding: 0.15rem 0 0.15rem 1rem;
  position: relative;
}

.position-details li::before {
  content: '›';
  position: absolute;
  left: 0;
  color: var(--accent-muted);
  font-weight: 700;
}

.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.badge {
  font-size: 0.69rem;
  background: var(--badge-bg);
  color: var(--badge-color);
  border-radius: 4px;
  padding: 0.18rem 0.55rem;
  font-weight: 500;
  letter-spacing: 0.2px;
}

/* ===================== EDUCATION ===================== */
.education-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.edu-card {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  border-left: 3px solid var(--accent-muted);
}

.edu-date {
  font-size: 0.71rem;
  color: var(--text-muted);
  font-weight: 500;
  line-height: 1.4;
  padding-top: 2px;
}

.edu-course {
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 0.25rem;
  line-height: 1.35;
}

.edu-place {
  font-size: 0.76rem;
  color: var(--accent);
  margin-bottom: 0.25rem;
}

.edu-place i { font-size: 0.7rem; }

.edu-details {
  font-size: 0.76rem;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.4;
}

/* ===================== RIGHT SIDEBAR ===================== */
.cv-right {
  background: var(--sidebar-bg);
  padding: 2.2rem 1.8rem;
}

.cv-aside-section { margin-bottom: 1.8rem; }

.aside-title {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-bottom: 0.4rem;
  border-bottom: 2px solid var(--border);
}

.aside-title i {
  color: var(--accent);
  font-size: 0.78rem;
}

/* ===================== SKILLS ===================== */
.skill-group { margin-bottom: 0.85rem; }

.skill-category {
  display: block;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 0.35rem;
}

.skill-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}

.skill-tag {
  font-size: 0.73rem;
  background: var(--bg);
  color: var(--primary);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.18rem 0.5rem;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s;
}

/* ===================== LANGUAGES ===================== */
.language-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.45rem 0.65rem;
  background: var(--bg);
  border-radius: 5px;
  border: 1px solid var(--border);
  margin-bottom: 0.4rem;
}

.lang-name {
  font-weight: 600;
  font-size: 0.82rem;
}

.lang-level {
  font-size: 0.72rem;
  color: var(--green);
  background: var(--green-light);
  padding: 0.15rem 0.5rem;
  border-radius: 10px;
  font-weight: 500;
}

/* ===================== DIPLOMAS ===================== */
.diploma-list { list-style: none; }

.diploma-list li {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.4rem;
  display: flex;
  align-items: flex-start;
  gap: 0.45rem;
  line-height: 1.4;
}

.diploma-list li i {
  color: var(--accent);
  font-size: 0.7rem;
  margin-top: 3px;
  flex-shrink: 0;
}

/* ===================== CERTIFICATIONS ===================== */
.cert-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cert-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--cert-color, var(--accent));
  border-radius: 0 6px 6px 0;
  padding: 0.5rem 0.75rem;
}

.cert-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--cert-color, var(--accent));
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cert-icon i {
  color: #fff;
  font-size: 0.78rem;
}

.cert-logo {
  width: 18px;
  height: 18px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}

.cert-info {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}

.cert-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.cert-issuer {
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ===================== INTERESTS ===================== */
.interest-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.interest-tag {
  font-size: 0.73rem;
  background: var(--bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.22rem 0.55rem;
}

/* ===================== FOOTER ===================== */
.cv-footer {
  text-align: center;
  padding: 0.9rem 2rem;
  font-size: 0.72rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: var(--card-bg);
  letter-spacing: 0.3px;
}

/* ===================== PRINT ===================== */
@media print {
  body { background: #fff; font-size: 12px; }
  .cv-page {
    margin: 0;
    box-shadow: none;
    border-radius: 0;
    max-width: 100%;
  }
  .cv-header {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  .position, .edu-card { break-inside: avoid; }
  .cv-right { background: #f1f5f9; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .badge, .skill-tag, .date-badge, .lang-level, .interest-tag { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}

/* ===================== RESPONSIVE (screen only) ===================== */
@media screen and (max-width: 800px) {
  .cv-page { margin: 0; border-radius: 0; }
  .cv-header { padding: 1.5rem; }
  .header-inner { flex-direction: column; gap: 1rem; text-align: center; }
  .header-contacts { justify-content: center; }
  .cv-body { grid-template-columns: 1fr; }
  .cv-left { padding: 1.5rem; border-right: none; border-bottom: 1px solid var(--border); }
  .cv-right { padding: 1.5rem; }
  .edu-card { grid-template-columns: 1fr; gap: 0.3rem; }
}
