* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --bg-color: #f5f7fa;
  --text-color: #2d3748;
  --header-bg: #667eea;
  --header-text: #ffffff;
  --nav-hover: #5a67d8;
  --card-bg: #ffffff;
  --card-border: #e2e8f0;
  --footer-bg: #667eea;
  --footer-text: #ffffff;
  --link-color: #667eea;
  --shadow: rgba(102, 126, 234, 0.15);
}

body.dark-mode {
  --bg-color: #1a202c;
  --text-color: #e2e8f0;
  --header-bg: #2d3748;
  --header-text: #f7fafc;
  --nav-hover: #4a5568;
  --card-bg: #2d3748;
  --card-border: #4a5568;
  --footer-bg: #2d3748;
  --footer-text: #f7fafc;
  --link-color: #90cdf4;
  --shadow: rgba(0, 0, 0, 0.3);
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Header Styles */
header {
  background-color: var(--header-bg);
  color: var(--header-text);
  padding: 1rem 0;
  box-shadow: 0 2px 5px var(--shadow);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem;
}

h1 {
  font-size: 1.8rem;
  font-weight: 600;
}

/* Navigation Styles */
nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

nav a {
  color: var(--header-text);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

nav a:hover {
  background-color: var(--nav-hover);
}

/* Hamburger Menu */
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 2001;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background-color: var(--header-text);
  margin: 3px 0;
  transition: all 0.3s ease;
  border-radius: 3px;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

/* Mobile Navigation */
.mobile-nav {
  position: fixed;
  top: 0;
  right: -100%;
  width: 70%;
  max-width: 300px;
  height: 100vh;
  background-color: var(--header-bg);
  padding: 5rem 2rem 2rem 2rem;
  transition: right 0.3s ease;
  z-index: 2000;
  box-shadow: -2px 0 10px var(--shadow);
}

.mobile-nav.active {
  right: 0;
}

.mobile-nav a {
  display: block;
  color: var(--header-text);
  text-decoration: none;
  padding: 1rem;
  margin-bottom: 0.5rem;
  border-radius: 4px;
  transition: background-color 0.3s ease;
}

.mobile-nav a:hover {
  background-color: var(--nav-hover);
}

.mobile-nav .settings-btn {
  width: 100%;
  justify-content: center;
  margin-top: 1rem;
}

/* Overlay */
.overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 1999;
}

.overlay.active {
  display: block;
}

/* Settings Button */
.settings-btn {
  background-color: transparent;
  border: 2px solid var(--header-text);
  color: var(--header-text);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: all 0.3s ease;
}

.settings-btn:hover {
  background-color: var(--header-text);
  color: var(--header-bg);
}

/* Main Content */
main {
  max-width: 1200px;
  margin: 2rem auto;
  padding: 0 2rem;
  min-height: calc(100vh - 300px);
}

.intro {
  text-align: center;
  margin-bottom: 3rem;
}

.intro h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.intro p {
  font-size: 1.1rem;
  color: var(--text-color);
  opacity: 0.8;
}

/* Project Grid */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

.project-card {
  background-color: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: 8px;
  padding: 1.5rem;
  box-shadow: 0 2px 8px var(--shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 12px var(--shadow);
}

.project-card h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--link-color);
}

.project-card p {
  margin-bottom: 1rem;
  opacity: 0.9;
}

.project-card .tech-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tech-tag {
  background-color: #e0e7ff;
  color: #5a67d8;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 500;
}

.project-link {
  display: inline-block;
  color: var(--link-color);
  text-decoration: none;
  font-weight: 600;
  transition: opacity 0.3s ease;
}

.project-link:hover {
  opacity: 0.7;
}

/* Footer Styles */
footer {
  background-color: var(--footer-bg);
  color: var(--footer-text);
  padding: 2rem 0;
  margin-top: 4rem;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 3rem;
  flex-wrap: wrap;
}

.footer-section {
  flex: 1;
  min-width: 200px;
}

.footer-section h3 {
  margin-bottom: 1rem;
  font-size: 1.2rem;
}

.footer-section p,
.footer-section a {
  color: var(--footer-text);
  opacity: 0.8;
  text-decoration: none;
  display: block;
  margin-bottom: 0.5rem;
}

.footer-section a:hover {
  opacity: 1;
  text-decoration: underline;
}

.social-links {
  display: flex;
  gap: 1rem;
  margin-top: 0.5rem;
  flex-wrap: wrap;
}

.social-links a {
  width: 40px;
  height: 40px;
  background-color: #a5b4fc;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: transform 0.3s ease, background-color 0.3s ease;
}

.social-links a:hover {
  transform: scale(1.1);
  background-color: #818cf8;
}

.copyright {
  text-align: center;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  opacity: 0.7;
  width: 100%;
}

/* Modal Styles */
.modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 2000;
  justify-content: center;
  align-items: center;
}

.modal.active {
  display: flex;
}

.modal-content {
  background-color: var(--card-bg);
  padding: 2rem;
  border-radius: 8px;
  max-width: 400px;
  width: 90%;
  box-shadow: 0 4px 20px var(--shadow);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-color);
}

.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  border-bottom: 1px solid var(--card-border);
}

/* Toggle Switch */
.switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 34px;
}

.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 34px;
}

.slider:before {
  position: absolute;
  content: "";
  height: 26px;
  width: 26px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .slider {
  background-color: var(--link-color);
}

input:checked + .slider:before {
  transform: translateX(26px);
}

/* Responsive Design */
@media (max-width: 768px) {
  .header-container {
    flex-direction: row;
    justify-content: space-between;
  }

  nav {
    display: none;
  }

  .hamburger {
    display: flex;
  }

  h1 {
    font-size: 1.5rem;
  }

  .intro h2 {
    font-size: 1.5rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }

  .footer-container {
    flex-direction: column;
    gap: 2rem;
  }

  .footer-section {
    text-align: center;
    width: 100%;
  }

  .social-links {
    justify-content: center;
  }
}
