/* -------------------- Theme Variables----------------- */
:root {
  --bg-color: #fafafa;
  --text-color: #333;
  --card-bg: #fff;
  --border-color: #eee;
  --accent: #0070f3;
  --slider: #aaaaaa;
  --slider-background: #e2e1e1;
}

body[data-theme="dark"] {
  --bg-color: #121212;
  --text-color: #eee;
  --card-bg: #1e1e1e;
  --border-color: #333;
  --accent: #58a6ff;
}

/* --------------- Global Styles ---------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  scroll-behavior: smooth;
}

body {
  font-family: Arial, Helvetica, sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  transition: background 0.3s, color 0.3s;
}
h2 {
  margin-bottom: 1rem;
  text-align: center;
  margin-bottom: 2rem;
}

.container {
  width: 90%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem 0;
}

/* -------------- Header --------------------- */
.site-header {
  background-color: var(--card-bg);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: background 0.3s, border-color 0.3s;
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  font-size: 1.5rem;
}

.site-nav ul {
  list-style: none;
  display: flex;
  gap: 1.5rem;
}

.site-nav a {
  text-decoration: none;
  color: var(--text-color);
  transition: color 0.3s;
}

.site-nav a:hover {
  color: var(--accent);
}

/* -------------- Theme Toggle  --------------- */

.theme-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 24px;
}

.theme-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: var(--slider-background);
  transition: 0.4s;
  border-radius: 24px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: var(--slider);
  transition: 0.4s;
  border-radius: 50%;
}

.theme-switch .slider::after {
  content: '🌙';
  position: absolute;
  right: 8px;
  top: auto;
  font-size: 14px;
  opacity: 1;
  transition: opacity 0.4s ease, transform 0.4s ease;
}

.theme-switch input:checked + .slider {
  background-color: var(--accent);
}
.theme-switch input:checked + .slider:before {
  transform: translateX(26px);
}
.theme-switch input:checked + .slider::after {
  content: '☀️';
  left: 6px;
  right: auto;
}

/*  -------------- Hero -------------- */
.hero-section {
  text-align: center;
  padding: 4rem 0;
}

/* -------------- Projects ------------- */

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2rem;
}

.project-card {
  background-color: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s, box-shadow 0.3s;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.project-card img {
  width: 100%;
  display: block;
}

.project-content {
  padding: 1rem;
}

.project-content p {
  margin-bottom: 1rem;
  color: var(--text-color);
}

.button {
  display: inline-block;
  padding: 0.6rem 1.2rem;
  background-color: var(--accent);
  color: #fff;
  text-decoration: none;
  border-radius: 4px;
  transition: background 0.3s;
}

.button:hover {
  background-color: #005bb5;
}

/* ------------ Skills ----------------- */
.skills-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1rem;
}

.skills-list li {
  background-color: var(--card-bg);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  flex-direction: column;
}

/* ----------------- Contact ---------------*/
.contact-section {
  text-align: center;
  padding: 4rem 0;
}
.contact-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
}
.contact-icon {
  width: 24px;
  height: 24px;
}

.contact-links a {
  color: var(--accent);
  text-decoration: none;
  font-weight: bold;
}

.contact-links a:hover {
  text-decoration: underline;
}

/* --------------- Footer ------------------ */
.site-footer {
  background: var(--card-bg);
  border-top: 1px solid var(--border-color);
  text-align: center;
  padding: 2rem 0;
}
