/* 1. Global Styles & Variables */
:root {
  --bg-color: #121212;
  --surface-color: #1e1e1e;
  --primary-color: #bb86fc;
  --secondary-color: #03dac6;
  --text-color: #e0e0e0;
  --text-muted-color: #a0a0a0;
  --border-color: #333;
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
}

h1, h2, h3, h4 {
  color: white;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h1 { font-size: 3rem; }
h2 { font-size: 2.2rem; border-bottom: 2px solid var(--primary-color); display: inline-block; padding-bottom: 0.5rem; }
h3 { font-size: 1.4rem; color: var(--primary-color); }
h4 { font-size: 1.1rem; color: var(--secondary-color); }

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

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

.hidden {
  display: none !important;
}

/* 2. Header & Navigation */
header {
  background-color: rgba(30, 30, 30, 0.8);
  backdrop-filter: blur(10px);
  padding: 1rem 5%;
  position: fixed;
  width: 100%;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

nav {
  display: flex;
  align-items: center;
  width: 100%;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: white;
}

.nav-links {
  margin-left: auto;
  display: flex;
  gap: 1.5rem;
}

.nav-links a {
  font-weight: 600;
  color: var(--text-color);
}

.menu-toggle {
  display: none;
  font-size: 1.5rem;
  color: white;
  cursor: pointer;
}

#language-switch {
  display: flex;
  gap: 0.5rem;
  margin-left: 2rem;
}

#language-switch button {
  background: none;
  border: 2px solid transparent;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 5px;
  transition: border-color 0.3s ease;
}

#language-switch button.active {
  border-color: var(--primary-color);
}

/* 3. Main Content & Sections */
main {
  padding-top: 80px; /* Header height */
}

.content-section {
  max-width: 1000px;
  margin: 4rem auto;
  padding: 2rem;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.content-section.visible {
  opacity: 1;
  transform: translateY(0);
}

/* 4. Hero Section */
.hero {
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 2rem;
  gap: 2rem;
}

.hero-text {
  max-width: 600px;
}

.hero .subtitle {
  font-size: 1.2rem;
  color: var(--text-muted-color);
  margin-bottom: 2rem;
}

.hero-image img {
  width: 300px;
  height: 300px;
  object-fit: cover;
  border-radius: 50%;
  border: 5px solid var(--surface-color);
  box-shadow: 0 0 20px rgba(187, 134, 252, 0.3);
}

.cta-button {
  background-color: var(--primary-color);
  color: #000;
  padding: 1rem 2rem;
  border-radius: 5px;
  font-weight: bold;
  display: inline-block;
}

/* 5. Card Layout */
.card-container, .project-grid {
  display: grid;
  gap: 1.5rem;
  margin-top: 2rem;
}

.card-container {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.project-grid {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.card {
  background-color: var(--surface-color);
  padding: 1.5rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 20px rgba(0,0,0,0.2);
}

.project-card {
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  cursor: pointer;
}

.project-card:hover {
  border-color: var(--primary-color);
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 12px 24px rgba(187, 134, 252, 0.15);
}

.card .card-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.card .card-header i {
  font-size: 1.5rem;
  color: var(--secondary-color);
}

.card .company {
  font-weight: bold;
  color: var(--text-muted-color);
}

.card .date {
  font-style: italic;
  color: var(--text-muted-color);
  font-size: 0.9rem;
}

/* Skills Section */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
  text-align: center;
}

.skill-item {
  background-color: var(--surface-color);
  padding: 1.5rem 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  transition: transform 0.4s ease, box-shadow 0.3s ease, border-color 0.3s ease, opacity 0.4s ease;
  opacity: 0;
  transform: translateY(20px);
}

.skill-item:hover {
  transform: translateY(-5px);
  border-color: var(--primary-color);
  box-shadow: 0 10px 20px rgba(187, 134, 252, 0.15);
}

.skill-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.skill-item i {
  font-size: 2.8rem;
  color: var(--secondary-color);
  margin-bottom: 1rem;
  transition: color 0.3s ease;
}

.skill-item:hover i {
  color: var(--primary-color);
}

.skill-item span {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
}

/* 6. Certifications & Contact */
.cert-list {
  columns: 2;
  column-gap: 2rem;
  margin-top: 2rem;
}

.cert-list p {
  margin-bottom: 0.5rem;
}

.cert-list i {
  color: var(--secondary-color);
  margin-right: 0.5rem;
}

.social-links {
  margin-top: 1rem;
}

.social-links a {
  font-size: 1.5rem;
  margin-right: 1rem;
}

/* Modal Styles */
.modal {
  visibility: hidden;
  opacity: 0;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.8);
  backdrop-filter: blur(5px);
  transition: opacity 0.3s ease, visibility 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal.show {
  visibility: visible;
  opacity: 1;
}

.modal-content {
  background-color: var(--surface-color);
  padding: 2.5rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  max-width: 600px;
  width: 90%;
  position: relative;
  transform: translateY(-20px);
  transition: transform 0.3s ease;
}

.modal.show .modal-content {
  transform: translateY(0);
}

.close-modal {
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  font-size: 1.5rem;
  color: var(--text-muted-color);
  cursor: pointer;
  transition: color 0.3s ease;
}

.close-modal:hover {
  color: var(--primary-color);
}

#modal-body {
  margin-top: 1rem;
  color: var(--text-color);
}

/* 7. Footer */
footer {
  text-align: center;
  padding: 2rem;
  margin-top: 2rem;
  background-color: var(--surface-color);
  color: var(--text-muted-color);
}

/* 8. Back to Top Button */
.back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background-color: var(--primary-color);
  color: #000;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: 0 4px 12px rgba(187, 134, 252, 0.3);
  transition: opacity 0.4s ease, transform 0.4s ease;
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none; /* Don't allow clicks when hidden */
  z-index: 50;
}

.back-to-top.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* 9. Responsive Design */
@media (max-width: 768px) {
  h1 { font-size: 2.5rem; }
  h2 { font-size: 1.8rem; }

  header {
    padding: 1rem 3%;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    background-color: var(--surface-color);
    flex-direction: column;
    padding: 1rem 0;
    gap: 0;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
  }

  .nav-links.active {
    display: flex;
  }

  .nav-links a {
    padding: 1rem 2rem;
    text-align: center;
  }

  .menu-toggle {
    display: block;
    margin-left: auto;
  }

  .hero {
    min-height: 70vh;
  }

  .hero-image img {
    width: 150px;
    height: 150px;
  }

  .cert-list {
    columns: 1;
  }
}