body {
  margin: 0;
  padding: 0;
  font-family: 'Montserrat', sans-serif;
  font-size: 20px;
}

.grid-container {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  grid-template-columns: 320px 1fr;
  min-height: 100vh;
  grid-template-areas:
    "header header"
    "personal main"
    "sidebar main"
    "footer footer";
}

header {
  grid-area: header;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 1.5rem;
  font-size: 1.5rem;
  text-transform: uppercase;
  font-weight: bold;
}

footer {
  grid-area: footer;
  text-align: center;
  padding: 1rem;
  font-size: 0.9rem;
}

footer p {
  margin: 0.3rem 0;
}

#personal-details {
  grid-area: personal;
  padding: 1rem;
  padding-bottom: 0;
}

aside {
  grid-area: sidebar;
  padding: 0 1rem 1rem 1rem;
}

main {
  grid-column: 2;
  grid-row: 2 / 4;
  padding: 1rem;
}

h2 {
  margin-top: 1rem;
  padding-bottom: 0.3rem;
  color: #000;
}

p,
li {
  margin: 0.3rem 0;
}

ul {
  padding-left: 1rem;
}

ul.links {
  list-style: none;
  padding-left: 0;
}

ul.links li a {
  color: #0077cc;
  text-decoration: none;
  word-break: break-word;
}

ul.links li a:hover,
a:hover {
  text-decoration: underline;
}

a {
  color: inherit;
  text-decoration: none;
}

aside h2,
#personal-details h2 {
  font-size: inherit;
  font-family: 'Montserrat', sans-serif;
}

aside span {
  font-size: xx-large;
  margin-left: 6px;
}

i {
  margin-right: 6px;
}

.intro {
  text-indent: 1.5rem;
  text-align: justify;
}

#title {
  grid-column: 2;
  text-align: center;
}

.lang-switcher {
  grid-column: 3;
  justify-self: end;
}

.lang-switcher a {
  padding: 10px 15px;
  background: #667eea;
  color: white;
  text-decoration: none;
  border-radius: 5px;
}

.lang-switcher a:hover {
  background: #764ba2;
}

.cv-download {
  grid-column: 1;
  justify-self: start;
  position: relative;
}

.cv-btn {
  padding: 10px 15px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-family: 'Montserrat', sans-serif;
  font-size: 1.5rem;
  font-weight: bold;
  text-transform: uppercase;
}

.cv-btn:hover {
  background: #764ba2;
}

.cv-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0;
  background: white;
  border: 2px solid #667eea;
  border-radius: 5px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  min-width: 180px;
  z-index: 1000;
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.3s ease-out, opacity 0.3s ease-out;
}

.cv-download:hover .cv-dropdown {
  max-height: 200px;
  opacity: 1;
}

.cv-dropdown a {
  display: block;
  padding: 10px 15px;
  color: #333;
  text-decoration: none;
  transition: background 0.2s;
  font-size: 0.9rem;
}

.cv-dropdown a:hover {
  background: #667eea;
  color: white;
  text-decoration: none;
}

.cv-dropdown a:first-child {
  border-radius: 3px 3px 0 0;
}

.cv-dropdown a:last-child {
  border-radius: 0 0 3px 3px;
}

/* Responsive Design for Mobile */
@media (max-width: 768px) {
  .grid-container {
    display: flex;
    flex-direction: column;
  }

  header {
    order: 1;
    grid-template-columns: 1fr;
    grid-template-rows: auto auto;
    padding: 1rem;
    gap: 1rem;
  }

  .cv-download {
    grid-column: 1;
    grid-row: 1;
    justify-self: start;
    display: inline-block;
  }

  .lang-switcher {
    grid-column: 1;
    grid-row: 1;
    justify-self: end;
    display: inline-block;
  }

  #title {
    grid-column: 1;
    grid-row: 2;
    text-align: center;
    font-size: 1.3rem;
  }

  .cv-btn,
  .lang-switcher a {
    padding: 8px 12px;
    font-size: 0.9rem;
  }

  .cv-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    margin-top: 0;
    min-width: 200px;
    z-index: 2000;
    transform: none;
  }

  .cv-dropdown.show {
    max-height: 200px;
    opacity: 1;
  }

  #personal-details {
    order: 2;
  }

  main {
    order: 3;
  }

  aside {
    order: 4;
    display: flex;
    flex-direction: column;
  }

  aside > div:nth-child(1) {
    order: 7;
  }

  aside > div:nth-child(2) {
    order: 1;
  }

  aside > div:nth-child(3) {
    order: 2;
  }

  aside > div:nth-child(4) {
    order: 3;
  }

  aside > div:nth-child(5) {
    order: 4;
  }

  aside > div:nth-child(6) {
    order: 5;
  }

  footer {
    order: 5;
  }

  #personal-details,
  aside,
  main {
    padding: 0.5rem 1rem;
  }

  body {
    font-size: 18px;
  }

  h2 {
    font-size: 1.2rem;
  }

  footer {
    font-size: 0.8rem;
    padding: 0.5rem;
  }
}