/* General Styles */
body {
  font-family: 'Poppins', sans-serif;
  margin: 0;
  padding: 0;
  background-color: #f4f4f9;
  color: #333;
  transition: background-color 0.3s, color 0.3s;
}

.dark-mode {
  background-color: #1a1a1a;
  color: #f4f4f9;
}

/* Header Styles */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 10%;
  background-color: #333;
  color: #fff;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1001;
  height: 80px;
}

header h1 {
  font-size: 2.5rem;
  margin: 0;
}

header p {
  font-size: 1.2rem;
  margin: 5px 0;
}

/* Center the image */
.header-image {
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 20px 0;
}

.header-image img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
}

/* Sidebar Styles */
#sidebar {
  background-color: #444;
  width: 200px;
  position: fixed;
  top: 80px;
  bottom: 0;
  left: 0;
  overflow-y: auto;
  padding-top: 20px;
  z-index: 1000;
}

#sidebar ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

#sidebar ul li a {
  color: #fff;
  text-decoration: none;
  padding: 10px 20px;
  display: block;
  transition: background-color 0.3s;
}

#sidebar ul li a:hover {
  background-color: #555;
}

#sidebar ul li a i {
  margin-right: 10px;
}

/* Main Content Styles */
#content {
  margin-left: 240px;
  padding-top: 150px;
  padding-right: 20px;
  padding-bottom: 20px;
  transition: margin-left 0.3s;
}

section {
  margin-bottom: 40px;
}

/* Buttons */
.cta-button {
  background-color: #007bff;
  color: #fff;
  padding: 10px 20px;
  border-radius: 5px;
  text-decoration: none;
  margin: 10px 5px;
  display: inline-block;
  transition: background-color 0.3s;
}

.cta-button:hover {
  background-color: #0056b3;
}

/* Skills Grid */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 20px;
}

.skill-card {
  background-color: #fff;
  padding: 20px;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s;
}

.skill-card:hover {
  transform: translateY(-10px);
}

.skill-card i {
  font-size: 2rem;
  margin-bottom: 10px;
}

/* Projects Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.project-card {
  background-color: #fff;
  padding: 20px;
  border-radius: 10px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s;
}

.project-card:hover {
  transform: translateY(-10px);
}

.project-link {
  color: #007bff;
  text-decoration: none;
  font-weight: bold;
}

/* Dark Mode Toggle */
.theme-toggle {
  position: fixed;
  top: 20px;
  right: 20px;
  background-color: #333;
  color: #fff;
  border: none;
  padding: 10px;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.3s;
}

.theme-toggle:hover {
  background-color: #555;
}

/* Back to Top Button */
#back-to-top {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  background-color: #333;
  color: #fff;
  border: none;
  padding: 10px;
  border-radius: 50%;
  cursor: pointer;
  transition: background-color 0.3s;
}

#back-to-top:hover {
  background-color: #555;
}

/* Resume Preview Styles */
.resume-preview {
  margin-top: 20px;
  border: 1px solid #ddd;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.resume-preview iframe {
  border: none;
}

/* Responsive Design for Mobile Devices */
@media (max-width: 768px) {
  /* Header */
  header {
    padding: 10px 5%;
    height: 60px;
  }

  header h1 {
    font-size: 1.8rem;
  }

  header p {
    font-size: 1rem;
  }

  /* Sidebar */
  #sidebar {
    width: 100%;
    height: auto;
    top: 60px; /* Adjusted for smaller header */
    bottom: auto;
    position: relative;
    padding-top: 10px;
  }

  #sidebar ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
  }

  #sidebar ul li {
    flex: 1 1 50%; /* Two items per row */
    text-align: center;
  }

  #sidebar ul li a {
    padding: 10px;
  }

  /* Main Content */
  #content {
    margin-left: 0;
    padding-top: 100px; /* Adjusted for smaller header */
    padding-right: 10px;
    padding-left: 10px;
  }

  /* Header Image */
  .header-image img {
    width: 120px;
    height: 120px;
  }

  /* Skills Grid */
  .skills-grid {
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  }

  /* Projects Grid */
  .projects-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }

  /* Buttons */
  .cta-button {
    padding: 8px 16px;
    font-size: 0.9rem;
  }

  /* Dark Mode Toggle */
  .theme-toggle {
    top: 10px;
    right: 10px;
    padding: 8px;
  }

  /* Back to Top Button */
  #back-to-top {
    bottom: 10px;
    right: 10px;
    padding: 8px;
  }
}

