* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: Arial, sans-serif;
  color: #333;
  background-color: #fff;
  line-height: 1.6;
  transition: background-color 0.3s, color 0.3s;
}

a {
  color: #0077cc;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 40px;
  background-color: #fff;
  border-bottom: 1px solid #ddd;
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background-color 0.3s, border-color 0.3s;
}

.nav-logo {
  font-size: 20px;
  font-weight: bold;
  color: #333;
  transition: color 0.3s;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 24px;
}

.nav-links a {
  color: #333;
  font-size: 15px;
  transition: color 0.3s;
}

.nav-links a:hover {
  color: #0077cc;
  text-decoration: none;
}

.theme-toggle {
  background: none;
  border: none;
  font-size: 20px;
  cursor: pointer;
  margin-left: 20px;
  margin-right: 12px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: background-color 0.3s;
}

.theme-toggle:hover {
  background-color: #e8f0fe;
}

.hamburger {
  display: none;
  font-size: 24px;
  background: none;
  border: none;
  cursor: pointer;
  color: #333;
  transition: color 0.3s;
}

@media (max-width: 600px) {
  .nav-links {
    display: none;
    flex-direction: column;
    gap: 12px;
    position: absolute;
    top: 57px;
    left: 0;
    width: 100%;
    background-color: #fff;
    padding: 20px 40px;
    border-bottom: 1px solid #ddd;
    transition: background-color 0.3s, border-color 0.3s;
  }

  .nav-links.open {
    display: flex;
  }

  .hamburger {
    display: block;
  }
}

.hero {
  text-align: center;
  padding: 80px 20px;
  background-color: #f0f6ff;
  transition: background-color 0.3s;
}

.hero h1 {
  font-size: 40px;
  margin-bottom: 16px;
  color: #222;
  transition: color 0.3s;
}

.hero p {
  font-size: 18px;
  color: #555;
  margin-bottom: 28px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
  transition: color 0.3s;
}

.btn {
  display: inline-block;
  padding: 12px 28px;
  background-color: #0077cc;
  color: #fff;
  border-radius: 6px;
  font-size: 15px;
  border: none;
  cursor: pointer;
}

.btn:hover {
  background-color: #005fa3;
  text-decoration: none;
}

.btn-outline {
  background-color: #fff;
  color: #0077cc;
  border: 2px solid #0077cc;
  transition: background-color 0.3s, color 0.3s;
}

.btn-outline:hover {
  background-color: #e8f0fe;
}

.hero-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.section {
  padding: 60px 40px;
  max-width: 900px;
  margin: 0 auto;
}

.section h2 {
  font-size: 28px;
  margin-bottom: 16px;
  color: #222;
  border-bottom: 2px solid #0077cc;
  padding-bottom: 8px;
  transition: color 0.3s, border-color 0.3s;
}

.section p {
  color: #555;
  margin-bottom: 12px;
  transition: color 0.3s;
}

.gray-bg {
  background-color: #f7f7f7;
  max-width: 100%;
  padding: 60px 40px;
  transition: background-color 0.3s;
}

.gray-bg .section {
  padding: 0;
}

section.gray-bg {
  max-width: 100%;
  padding: 60px 0;
}

section.gray-bg h2,
section.gray-bg p,
section.gray-bg form,
section.gray-bg .skills-grid {
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 40px;
  padding-right: 40px;
}

section.gray-bg h2 {
  padding-bottom: 8px;
  margin-bottom: 16px;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-top: 24px;
}

.skill-card {
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  transition: background-color 0.3s, border-color 0.3s;
}

.skill-card:hover {
  border-color: #0077cc;
}

.skill-card p {
  font-weight: bold;
  color: #333;
  margin: 0;
  transition: color 0.3s;
}

@media (max-width: 600px) {
  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
  margin-top: 24px;
}

.project-card {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 20px;
  background-color: #fff;
  display: flex;
  flex-direction: column;
  transition: background-color 0.3s, border-color 0.3s;
}

.project-card:hover {
  border-color: #0077cc;
}

.project-card h3 {
  font-size: 18px;
  margin-bottom: 12px;
  color: #222;
  transition: color 0.3s;
}

.project-card p {
  font-size: 14px;
  color: #555;
  margin-bottom: 12px;
  transition: color 0.3s;
}

.project-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: auto;
  margin-bottom: 16px;
}

.project-tags span {
  background-color: #e8f0fe;
  color: #0077cc;
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 4px;
  transition: background-color 0.3s, color 0.3s;
}

/* Added styles for the Live Demo buttons */
.project-links {
  display: flex;
  gap: 16px;
  font-size: 14px;
  font-weight: bold;
  margin-top: auto;
}

.project-links a {
  display: inline-block;
  padding: 8px 16px;
  background-color: #0077cc;
  color: #fff;
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
  transition: background-color 0.3s;
}

.project-links a:hover {
  background-color: #005fa3;
  text-decoration: none;
}

body.dark-mode .project-links a {
  background-color: #4da3ff;
  color: #121212;
}

body.dark-mode .project-links a:hover {
  background-color: #3388dd;
}

#contact-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
  max-width: 560px;
}

#contact-form input,
#contact-form textarea {
  padding: 10px 14px;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 15px;
  font-family: Arial, sans-serif;
  outline: none;
  background-color: #fff;
  color: #333;
  transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}

#contact-form input:focus,
#contact-form textarea:focus {
  border-color: #0077cc;
}

.error-msg {
  color: red;
  font-size: 14px;
}

.success-msg {
  color: green;
  font-size: 14px;
}

footer {
  text-align: center;
  padding: 30px 20px;
  background-color: #222;
  color: #aaa;
  font-size: 14px;
  transition: background-color 0.3s, color 0.3s;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 20px;
  margin-top: 10px;
}

.footer-links a {
  color: #aaa;
  font-size: 14px;
  transition: color 0.3s;
}

.footer-links a:hover {
  color: #fff;
  text-decoration: none;
}

body.dark-mode {
  background-color: #121212;
  color: #e0e0e0;
}

body.dark-mode .navbar {
  background-color: #1e1e1e;
  border-bottom-color: #333;
}

body.dark-mode .nav-logo,
body.dark-mode .nav-links a,
body.dark-mode .hamburger {
  color: #e0e0e0;
}

body.dark-mode .nav-links a:hover {
  color: #4da3ff;
}

body.dark-mode .theme-toggle:hover {
  background-color: #2a2a2a;
}

@media (max-width: 600px) {
  body.dark-mode .nav-links {
    background-color: #1e1e1e;
    border-bottom-color: #333;
  }
}

body.dark-mode .hero {
  background-color: #1a1a2e;
}

body.dark-mode .hero h1 {
  color: #f0f0f0;
}

body.dark-mode .hero p {
  color: #b0b0b0;
}

body.dark-mode .section h2 {
  color: #f0f0f0;
  border-bottom-color: #4da3ff;
}

body.dark-mode .section p {
  color: #b0b0b0;
}

body.dark-mode .gray-bg {
  background-color: #1a1a1a;
}

body.dark-mode .skill-card,
body.dark-mode .project-card {
  background-color: #2a2a2a;
  border-color: #444;
}

body.dark-mode .skill-card:hover,
body.dark-mode .project-card:hover {
  border-color: #4da3ff;
}

body.dark-mode .skill-card p {
  color: #e0e0e0;
}

body.dark-mode .project-card h3 {
  color: #f0f0f0;
}

body.dark-mode .project-card p {
  color: #b0b0b0;
}

body.dark-mode .project-tags span {
  background-color: #2a3a5a;
  color: #4da3ff;
}

body.dark-mode .btn-outline {
  background-color: transparent;
  color: #4da3ff;
  border-color: #4da3ff;
}

body.dark-mode .btn-outline:hover {
  background-color: #1a2a4a;
}

body.dark-mode #contact-form input,
body.dark-mode #contact-form textarea {
  background-color: #2a2a2a;
  color: #e0e0e0;
  border-color: #444;
}

body.dark-mode #contact-form input:focus,
body.dark-mode #contact-form textarea:focus {
  border-color: #4da3ff;
}

body.dark-mode footer {
  background-color: #0a0a0a;
  color: #888;
}

body.dark-mode .footer-links a {
  color: #888;
}

body.dark-mode .footer-links a:hover {
  color: #fff;
}