:root {
  --primary-color: #10b981;
  --primary-dark: #059669;
  --secondary-color: #6b7280;
  --accent-color: #34d399;
  --background-color: #1f2937;
  --card-background: #374151;
  --text-primary: #f9fafb;
  --text-secondary: #d1d5db;
  --border-color: #4b5563;
  --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3), 0 2px 4px -1px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -2px rgba(0, 0, 0, 0.2);
}

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

html {
  background: linear-gradient(135deg, #1f2937 0%, #374151 50%, #111827 100%);
  background-attachment: fixed;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: none;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: linear-gradient(135deg, #1f2937 0%, #374151 50%, #111827 100%);
  background-attachment: fixed;
  min-height: 100vh;
  color: var(--text-primary);
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: none;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.cv-wrapper {
  background: var(--card-background);
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  display: grid;
  grid-template-columns: 350px 1fr;
  grid-template-rows: auto 1fr;
  min-height: 80vh;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* Header Section */
.header {
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 3rem 2rem;
  text-align: center;
  position: relative;
  grid-column: 1;
  grid-row: 1;
  box-shadow: 0 8px 32px rgba(16, 185, 129, 0.3);
}

.header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grid" width="10" height="10" patternUnits="userSpaceOnUse"><path d="M 10 0 L 0 0 0 10" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="0.5"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  opacity: 0.3;
}

.profile-image {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  border: 4px solid rgba(255, 255, 255, 0.3);
  margin: 0 auto 1.5rem;
  background: linear-gradient(45deg, #f0f9ff, #e0f2fe);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--primary-color);
  position: relative;
  z-index: 1;
  overflow: hidden;
}

.avatar-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.avatar-fallback {
  display: none;
  font-size: 3rem;
  color: var(--primary-color);
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.header h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  position: relative;
  z-index: 1;
}

.header .title {
  font-size: 1.2rem;
  opacity: 0.9;
  margin-bottom: 2rem;
  position: relative;
  z-index: 1;
}

.download-btn {
  background: rgba(255, 255, 255, 0.2);
  border: 2px solid rgba(255, 255, 255, 0.3);
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 500;
  transition: all 0.3s ease;
  position: relative;
  z-index: 1;
}

.download-btn:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-2px);
}

/* Language Switcher */
.language-switcher {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 10;
}

.language-dropdown {
  position: relative;
  display: inline-block;
}

.language-toggle {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  padding: 0.6rem 1rem;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.9rem;
  font-weight: 500;
  min-width: 90px;
  justify-content: space-between;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.language-toggle:hover {
  background: rgba(255, 255, 255, 0.25);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

.language-toggle.active {
  background: rgba(255, 255, 255, 0.3);
}

.language-toggle i {
  font-size: 0.7rem;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.8;
}

.language-toggle.active i {
  transform: rotate(180deg);
}

.current-flag {
  font-size: 1.1rem;
  line-height: 1;
}

.current-lang {
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0.9;
}

.language-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: var(--card-background);
  backdrop-filter: blur(20px);
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  min-width: 160px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px) scale(0.95);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1000;
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.language-menu.show {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.language-option {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  cursor: pointer;
  transition: all 0.2s ease;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  font-weight: 500;
}

.language-option .lang-name {
  color: var(--text-primary) !important;
  font-weight: 500 !important;
}

.language-option * {
  opacity: 1 !important;
  visibility: visible !important;
  display: block !important;
}

.language-option .lang-name {
  opacity: 1 !important;
  visibility: visible !important;
  display: block !important;
  color: inherit !important;
}

.language-option:last-child {
  border-bottom: none;
}

.language-option:hover {
  background: rgba(16, 185, 129, 0.1);
  color: var(--primary-color);
}

.language-option.active {
  background: var(--primary-color);
  color: white;
}

.language-option.active:hover {
  background: var(--primary-dark);
  color: white;
}

.flag-icon {
  font-size: 1.1rem;
  line-height: 1;
}

.lang-name {
  font-weight: 500;
  font-size: 0.9rem;
  opacity: 1;
  visibility: visible;
  display: block;
}

/* Sidebar */
.sidebar {
  background: var(--card-background);
  padding: 2rem;
  border-right: 1px solid var(--border-color);
  grid-column: 1;
  grid-row: 2;
}

.contact-info {
  margin-bottom: 2rem;
}

.contact-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
  color: var(--text-secondary);
}

.contact-item i {
  width: 20px;
  color: var(--primary-color);
}

.contact-item a {
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.3s ease;
}

.contact-item a:hover {
  color: var(--primary-color);
}

.section {
  margin-bottom: 2rem;
}

.section-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.skills-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.skill-tag {
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  color: white;
  padding: 0.4rem 0.8rem;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 500;
  text-align: center;
  transition: transform 0.3s ease;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.3);
}

.skill-tag:hover {
  transform: translateY(-2px);
}

.language-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-color);
}

.language-item:last-child {
  border-bottom: none;
}

.language-name {
  font-weight: 500;
}

.language-level {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

.hobby-item {
  background: var(--background-color);
  padding: 0.75rem;
  border-radius: 10px;
  margin-bottom: 0.5rem;
  text-align: center;
  font-weight: 500;
  color: var(--text-primary);
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.hobby-item:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
}

/* Main Content */
.main-content {
  padding: 2rem;
  background: var(--card-background);
  grid-column: 2;
  grid-row: 1 / 3;
  display: block;
  width: 100%;
  box-sizing: border-box;
}

.profile-section,
.experience-section,
.education-section {
  margin-bottom: 2.5rem;
}

.profile-section h2,
.experience-section h2,
.education-section h2 {
  color: var(--text-primary);
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary-color);
  text-align: left;
}

.profile-text {
  font-size: 1.1rem;
  line-height: 1.8;
  color: var(--text-secondary);
  margin-bottom: 1rem;
  text-align: left;
  max-width: 100%;
}

.experience-item {
  margin-bottom: 2rem;
  padding: 1.5rem;
  background: var(--background-color);
  border-radius: 15px;
  border-left: 4px solid var(--primary-color);
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.experience-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.company-name {
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  text-align: left;
}

.project-info {
  display: flex;
  gap: 2rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: flex-start;
}

.project-detail {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.project-detail strong {
  color: var(--primary-color);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.responsibilities {
  margin: 1rem 0;
  text-align: left;
}

.responsibilities ul {
  list-style: none;
  padding-left: 0;
}

.responsibilities li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.responsibilities li::before {
  content: '▶';
  position: absolute;
  left: 0;
  color: var(--primary-color);
  font-size: 0.8rem;
}

.technologies {
  background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
  color: white;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-weight: 500;
  margin-top: 1rem;
  text-align: left;
}

.education-item {
  background: var(--background-color);
  padding: 1.5rem;
  border-radius: 15px;
  margin-bottom: 1rem;
  border-left: 4px solid var(--accent-color);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.education-title {
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  text-align: left;
}

.education-details {
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-align: left;
}

/* Dynamic containers */
.experience-items,
.education-items {
  width: 100%;
}


/* Responsive Design */
@media (max-width: 768px) {
  .cv-wrapper {
    grid-template-columns: 1fr;
  }
  
  .container {
    padding: 1rem;
  }
  
  .header {
    padding: 2rem 1rem;
  }
  
  .header h1 {
    font-size: 2rem;
  }
  
  .skills-grid {
    grid-template-columns: 1fr;
  }
  
  .project-info {
    flex-direction: column;
    gap: 1rem;
  }
  
  .language-switcher {
    top: 1rem;
    right: 1rem;
  }
  
  .language-toggle {
    padding: 0.5rem 0.8rem;
    font-size: 0.85rem;
    min-width: 75px;
  }
  
  .language-menu {
    min-width: 140px;
  }
  
  .flag-icon {
    font-size: 1rem;
  }
  
  .current-flag {
    font-size: 1rem;
  }
  
  .current-lang {
    font-size: 0.75rem;
  }
}

/* Animations */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.experience-item,
.education-item {
  animation: fadeInUp 0.6s ease-out;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--background-color);
}

::-webkit-scrollbar-thumb {
  background: var(--primary-color);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-dark);
}

/* Mobile and Tablet styles */
@media (max-width: 1024px) {
  .cv-wrapper {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto 1fr;
    gap: 1.5rem;
    padding: 1rem;
  }
  
  .header {
    grid-column: 1;
    grid-row: 1;
    text-align: center;
  }
  
  .sidebar {
    grid-column: 1;
    grid-row: 2;
  }
  
  .main-content {
    grid-column: 1;
    grid-row: 3;
  }
  
  .profile-image {
    margin: 0 auto 1.5rem;
  }
  
  .contact-info {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .contact-item {
    justify-content: center;
  }
  
  .skills-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
  }
  
  .language-dropdown {
    position: relative;
  }
  
  .language-menu {
    right: 0;
    left: auto;
    min-width: 140px;
  }
  
  .current-flag {
    font-size: 1rem;
  }
  
  .current-lang {
    font-size: 0.75rem;
  }
}

/* Mobile styles */
@media (max-width: 768px) {
  .cv-wrapper {
    padding: 0.75rem;
    gap: 1rem;
  }
  
  .header {
    padding: 1.5rem;
  }
  
  .sidebar {
    padding: 1.5rem;
  }
  
  .main-content {
    padding: 1.5rem;
  }
  
  .profile-image {
    width: 120px;
    height: 120px;
    margin-bottom: 1rem;
  }
  
  .avatar-img {
    width: 120px;
    height: 120px;
  }
  
  .avatar-fallback {
    width: 120px;
    height: 120px;
    font-size: 3rem;
  }
  
  h1 {
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
  }
  
  .title {
    font-size: 1rem;
    margin-bottom: 1rem;
  }
  
  .download-btn {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
  }
  
  .contact-info {
    gap: 0.75rem;
  }
  
  .contact-item {
    padding: 0.75rem;
    font-size: 0.9rem;
  }
  
  .contact-item i {
    font-size: 1rem;
  }
  
  .skills-grid {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 0.5rem;
  }
  
  .skill-tag {
    padding: 0.5rem 0.75rem;
    font-size: 0.8rem;
  }
  
  .language-toggle {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
  }
  
  .language-menu {
    min-width: 120px;
    right: 0;
  }
  
  .language-option {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
  }
  
  .current-flag {
    font-size: 0.9rem;
  }
  
  .current-lang {
    font-size: 0.7rem;
  }
  
  .section-title {
    font-size: 1.3rem;
    margin-bottom: 1rem;
  }
  
  .profile-text {
    font-size: 0.95rem;
    line-height: 1.6;
  }
  
  .experience-item,
  .education-item {
    padding: 1rem;
    margin-bottom: 1rem;
  }
  
  .experience-item h3,
  .education-item h3 {
    font-size: 1.1rem;
  }
  
  .experience-item .company,
  .education-item .institution {
    font-size: 0.9rem;
  }
  
  .experience-item .period,
  .education-item .period {
    font-size: 0.8rem;
  }
  
  .experience-item .description,
  .education-item .description {
    font-size: 0.9rem;
  }
}

/* Small mobile styles */
@media (max-width: 480px) {
  .cv-wrapper {
    padding: 0.5rem;
    gap: 0.75rem;
  }
  
  .header,
  .sidebar,
  .main-content {
    padding: 1rem;
  }
  
  .profile-image {
    width: 100px;
    height: 100px;
  }
  
  .avatar-img {
    width: 100px;
    height: 100px;
  }
  
  .avatar-fallback {
    width: 100px;
    height: 100px;
    font-size: 2.5rem;
  }
  
  h1 {
    font-size: 1.5rem;
  }
  
  .title {
    font-size: 0.9rem;
  }
  
  .download-btn {
    padding: 0.6rem 1.2rem;
    font-size: 0.8rem;
  }
  
  .contact-item {
    padding: 0.6rem;
    font-size: 0.8rem;
  }
  
  .skills-grid {
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
    gap: 0.4rem;
  }
  
  .skill-tag {
    padding: 0.4rem 0.6rem;
    font-size: 0.75rem;
  }
  
  .language-toggle {
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
  }
  
  .language-menu {
    min-width: 100px;
  }
  
  .language-option {
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
  }
  
  .section-title {
    font-size: 1.2rem;
  }
  
  .profile-text {
    font-size: 0.9rem;
  }
  
  .experience-item,
  .education-item {
    padding: 0.75rem;
  }
}
