/* Reset and base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-dark: #333;
  --text-light: #f5f5f5;

  --bg-primary: #f5f5f5;
  --bg-secondary: #fff;
  --bg-sidebar: #f8f8f8;
  --text-primary: #333;
  --text-secondary: #555;
  --text-tertiary: #666;
  --border-color: #ddd;
  --shadow-color: rgba(0, 0, 0, 0.1);
  --accent-color: #333;
}

body[data-theme="dark"] {
  --bg-dark: #1a1a1a;
  --bg-primary: #1a1a1a;
  --bg-secondary: #2d2d2d;
  --bg-sidebar: #252525;
  --text-primary: #e0e0e0;
  --text-secondary: #b0b0b0;
  --text-tertiary: #888;
  --border-color: #404040;
  --shadow-color: rgba(0, 0, 0, 0.3);
  --accent-color: #e0e0e0;
  --empty-color: #888;
}

html {
  font-size: 18px;
  line-height: 1.2;
}

body {
  font-family: "SF Pro Display", "SF Pro Text", system-ui, -apple-system, "Segoe UI", "Ubuntu", "Cantarell", sans-serif;
  color: var(--text-primary);
  background: var(--bg-primary);
  padding: 0;
  margin: 0;
  transition: background-color 0.3s ease, color 0.3s ease;
}

hr {
  border: none;
  border-top: 1px solid var(--border-color);
  margin: 1.5rem 0;
}

section {
  margin-bottom: 1.5rem;
}

dl {
  margin-bottom: 1rem;
}

h3 {
  margin-bottom: 0.5rem;
}

/* Floating controls */
.floating-controls {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.75rem 0.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-right: none;
  border-radius: 8px 0 0 8px;
  box-shadow: -2px 0 8px var(--shadow-color);
  z-index: 1000;
  transition: all 0.3s ease;
}

.control-btn {
  width: 40px;
  height: 40px;
  border: 1px solid var(--border-color);
  background: var(--bg-secondary);
  cursor: pointer;
  border-radius: 6px;
  /* font-size: 0.85rem; */
  font-weight: 600;
  transition: all 0.2s ease;
  color: var(--text-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.control-btn:hover {
  background: var(--bg-primary);
  border-color: var(--accent-color);
  transform: scale(1.05);
}

.control-btn.active {
  background: var(--accent-color);
  color: var(--bg-secondary);
  border-color: var(--accent-color);
}

.control-divider {
  height: 1px;
  background: var(--border-color);
  margin: 0.25rem 0;
}

.print-btn {
  font-size: 1.2rem;
}

/* Main container */
.cv-container {
  max-width: 1200px;
  margin: 0 auto;
  background: var(--bg-secondary);
  /* box-shadow: 0 0 20px var(--shadow-color); */
  display: grid;
  grid-template-columns: 35% 65%;
  min-height: 100vh;
}

/* Left column */
.left-column {
  padding: 0 2rem;
  border-right: 1px solid var(--border-color);
}

.profile-photo {
  max-width: 300px;
  max-height: 300px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: -.25rem 0 1.5rem;
}

/* Personal name heading */
#cvName {
  font-size: 3rem;
  font-weight: normal;
}

section h2 {
  font-size: 1.2rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

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

.contact-info a:hover {
  text-decoration: underline;
  color: var(--text-secondary);
}

.language-name {
  font-weight: 600;
  color: var(--text-primary);
}

.language-level {
  color: var(--text-tertiary);
  padding-bottom: 0.5rem;
}

.interests-section ul {
  list-style: none;
  padding: 0;
}

.interests-section li {
  padding: 0.4rem 0;
  position: relative;
  padding-left: 1rem;
}

.interests-section li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--accent-color);
  font-weight: bold;
}

.signature-section {
  text-align: center;
  color: var(--text-tertiary);
}

/* Right column */
.right-column {
  padding: 0 2rem;
}

.cv-header {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 0;
  text-align: center;
  background: var(--bg-secondary);
}

.cv-header h1 {
  font-size: 4rem;
  font-weight: 300;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.cv-subtitle {
  color: var(--text-secondary);
}

.intro-section h2,
.work-section h2,
.education-section h2,
.skills-section h2 {
  font-size: 2rem;
  line-height: 1.75;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 1rem;
  color: var(--text-light);
  font-weight: 500;
  background: var(--bg-dark);
  border-radius: 0;
  padding-left: 1.9rem;
  margin-left: -2rem;
  margin-right: -2rem;
}

.intro-section p {
  text-align: justify;
  line-height: 1.5;
}

/* Work experience separators */
cv-work-entry:not(:last-child) {
  border-bottom: 2px dotted var(--border-color);
  padding-bottom: 1.5rem;
  margin-bottom: 0 !important;
}

cv-work-entry:not(:first-child) {
  padding-top: 1.5rem;
}

/* Education styles */
.education-entry {
  margin-bottom: 1.5rem;
}

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

.institution {
  display: inline-block;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.education-entry .period {
  color: var(--text-tertiary);
  white-space: nowrap;
}

.degree {
  color: var(--text-tertiary);
  margin: 0;
}

.degree-info {
  color: var(--text-secondary);
  margin-top: 0.25rem;
}

.skill-category {
  margin-bottom: 1rem;
}

.skill-category-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.75rem;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.5rem 1.5rem;
}

.skill-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}

.skill-name {
  color: var(--text-secondary);
}

.tachometer-rating {
  display: inline-flex;
  align-items: flex-end;
  gap: 2px;
  cursor: help;
}

.tacho-bar {
  display: inline-block;
  width: 6px;
  border-radius: 1px 1px 0 0;
}

.tacho-bar:nth-child(1) {
  height: 6px;
}

.tacho-bar:nth-child(2) {
  height: 8px;
}

.tacho-bar:nth-child(3) {
  height: 10px;
}

.tacho-bar:nth-child(4) {
  height: 13px;
}

.tacho-bar:nth-child(5) {
  height: 16px;
}

.tacho-bar.empty {
  background-color: transparent;
  /* border: 1px solid #000; */
}

body[data-theme="dark"] .tacho-bar.filled {
  filter: invert(1);
}

/* Responsive design */
@media (max-width: 968px) {
  .cv-container {
    grid-template-columns: minmax(0, 1fr);
  }

  .left-column {
    border-right: none;
    border-bottom: 1px solid var(--border-color);
  }

  .floating-controls {
    right: 0.5rem;
    padding: 0.5rem 0.25rem;
  }

  .control-btn {
    width: 36px;
    height: 36px;
    /* font-size: 0.8rem; */
  }

  .cv-header h1 {
    font-size: 2rem;
  }
}

@media screen and (min-width: 641px) {
  .left-column {
    text-align: right;
  }

  .signature-image,
  .profile-photo {
    float: right;
  }
}

@media (max-width: 640px) {
  .cv-container {
    margin: 0;
    box-shadow: none;
  }

  .left-column,
  .right-column {
    padding: 1.5rem 1rem;
  }

  .intro-section h2,
  .work-section h2,
  .education-section h2,
  .skills-section h2 {
    margin-left: -1rem;
    margin-right: -1rem;
    padding-left: 1rem;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }

  .cv-header h1 {
    font-size: 1.75rem;
  }

  .floating-controls {
    flex-direction: row;
    right: auto;
    left: 50%;
    top: auto;
    bottom: 1rem;
    transform: translateX(-50%);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    flex-wrap: wrap;
    justify-content: center;
  }

  .control-divider {
    width: 1px;
    height: 20px;
    margin: 0 0.25rem;
  }

  footer.cv-footer {
    margin-bottom: 10rem;
  }
}

/* Footer */
.cv-footer {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 0;
  text-align: center;
  background: var(--bg-secondary);
  border-top: 1px solid var(--border-color);
}

.footer-content {
  color: var(--text-tertiary);
  /* font-size: 0.9rem; */
}

.footer-content p+p {
  margin-top: 0.5rem;
}

.footer-content a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-content a:hover {
  color: var(--accent-color);
  text-decoration: underline;
}