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

/* Base Theme Variables */
:root {
  --bg-color: #f9f9f9;
  --text-color: #333;
  --accent-color: #007acc;
  --link-hover: #005b99;
  --card-bg: #ffffff;
  --footer-bg: #eaeaea;
}

/* Body Styling */
body {
  font-family: "Segoe UI", sans-serif;
  background-color: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  padding-top: 80px;
}

/* Dark Theme Overrides */
body.dark-mode {
  --bg-color: #1e1e1e;
  --text-color: #eaeaea;
  --accent-color: #4da3ff;
  --link-hover: #74c0ff;
  --card-bg: #2a2a2a;
  --footer-bg: #111;
}

/* Sticky Transparent Navbar */
.navbar {
  position: fixed;
  width: 100%;
  top: 0;
  left: 0;
  z-index: 1000;
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
  background-color: transparent;
}

.navbar.scrolled {
  background-color: var(--card-bg);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  max-width: 1000px;
  margin: 0 auto;
  padding: 1rem 2rem;
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--accent-color);
  text-decoration: none;
}

.menu-toggle {
  display: none;
  font-size: 1.8rem;
  background: none;
  border: none;
  color: var(--text-color);
  cursor: pointer;
}

.nav-links {
  display: flex;
  gap: 1.5rem;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  transition: color 0.3s;
}

.nav-links a:hover {
  color: var(--accent-color);
}

/* Responsive Menu */
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    position: absolute;
    right: 2rem;
    top: 70px;
    background-color: var(--card-bg);
    padding: 1rem;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  }

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

.nav-links li a {
  text-decoration: none;
  color: var(--text-color);
  font-weight: 500;
  transition: color 0.3s ease;
}

.nav-links li a:hover {
  color: var(--accent-color);
}

/* Responsive Navigation */
@media (max-width: 600px) {
  .nav-links {
    flex-direction: column;
    position: absolute;
    top: 60px;
    right: 2rem;
    background-color: var(--card-bg);
    padding: 1rem;
    display: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  }

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

/* Hero Section */
.hero {
  text-align: center;
  padding: 4rem 2rem;
  background-color: var(--card-bg);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  position: relative;
}

#theme-toggle {
  top: 1rem;
  right: 1rem;
  font-size: 1.2rem;
  background: none;
  border: none;
  cursor: pointer;
}

.hero-img {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  object-fit: cover;
  margin-bottom: 1rem;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.hero h1 span {
  color: var(--accent-color);
}

.hero p {
  font-size: 1.2rem;
}

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

.social-links a {
  margin: 0 10px;
  text-decoration: none;
  color: var(--accent-color);
  font-weight: bold;
  transition: color 0.3s;
}

.social-links a:hover {
  color: var(--link-hover);
}

/* About Section */
.about {
  max-width: 800px;
  margin: 2rem auto;
  padding: 0 2rem;
}

.about h2 {
  font-size: 2rem;
  margin-bottom: 1rem;
}

.about p {
  font-size: 1.1rem;
}

/* Portfolio Section */
.portfolio {
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 2rem;
}

.project-list {
  display: grid;
  gap: 1.5rem;
}

.project {
  background-color: var(--card-bg);
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.05);
}

.project h3 {
  margin-bottom: 0.5rem;
}

.project p {
  color: var(--text-color);
}

.project a {
  display: inline-block;
  margin-top: 0.5rem;
  text-decoration: none;
  color: var(--accent-color);
  font-weight: bold;
}

/* Contact Section */
.contact {
  max-width: 700px;
  margin: 3rem auto;
  padding: 0 2rem;
}

.contact form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact input,
.contact textarea {
  padding: 0.8rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  background-color: var(--card-bg);
  color: var(--text-color);
}

.contact button {
  padding: 0.8rem;
  background-color: var(--accent-color);
  color: white;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
}

.contact button:hover {
  background-color: var(--link-hover);
}

#form-response {
  margin-top: 1rem;
  color: green;
  font-weight: bold;
}

/* Gallery */
.gallery {
  max-width: 900px;
  margin: 3rem auto;
  padding: 0 2rem;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1rem;
}

.gallery img {
  width: 100%;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

/* Sidebar styles */
.sidebar {
  width: 260px;
  min-width: 220px;
  background: var(--card-bg);
  color: var(--text-color);
  border-right: 1px solid rgba(0,0,0,0.05);
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 1100;
  padding: 1rem 0;
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, width 0.25s ease;
  box-shadow: 2px 0 8px rgba(0,0,0,0.03);
}

/* Sidebar state helpers */
.sidebar.open {
  transform: translateX(0);
}

.sidebar.closed {
  transform: translateX(-100%);
}

/* Hide by transform for small screens when collapsed via script/class */
.sidebar.collapsed {
  transform: translateX(-100%);
}

/* Header */
.sidebar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  gap: 0.5rem;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  color: var(--accent-color);
  text-decoration: none;
}

.logo-icon {
  font-size: 1.15rem;
}

/* Toggler */
.sidebar-toggle {
  background: none;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  color: var(--text-color);
  padding: 0.25rem 0.5rem;
  z-index: 1200;
}

/* body state to adjust main content if needed */
body.has-sidebar-closed .main-content {
  margin-left: 0;
  transition: margin 0.25s ease;
}

/* Navigation */
.sidebar-nav {
  padding: 0.5rem 0;
  overflow-y: auto;
  flex: 1 1 auto;
}

.nav-section {
  padding: 0.5rem 1rem;
}

.nav-section + .nav-section {
  margin-top: 0.25rem;
}

.nav-section-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-color);
  margin-bottom: 0.4rem;
  display: block;
}

.nav-menu {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.nav-menu .nav-link {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  text-decoration: none;
  color: var(--text-color);
  transition: background-color 0.15s, color 0.15s;
}

.nav-menu .nav-link:hover,
.nav-menu .nav-link:focus {
  background: rgba(0,0,0,0.03);
  color: var(--accent-color);
  text-decoration: none;
}

.nav-footer {
  margin-top: auto;
  padding: 0.75rem 1rem;
  border-top: 1px solid rgba(0,0,0,0.03);
}

/* Footer small button */
.sidebar-footer {
  padding: 0.5rem 1rem;
  display: flex;
  justify-content: center;
}

.theme-toggle-btn {
  background: none;
  border: 1px solid rgba(0,0,0,0.06);
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  cursor: pointer;
}

/* Small screens */
@media (max-width: 900px) {
  .sidebar {
    width: 220px;
    transform: translateX(-100%); /* hidden by default on small screens */
  }

  .sidebar.open {
    transform: translateX(0);
  }

  /* Move body content so it doesn't overlap with sidebar when visible (handled by page JS) */
  .has-sidebar-open .main-content {
    margin-left: 220px;
  }
}

/* Footer */
footer {
  text-align: center;
  padding: 1rem;
  font-size: 0.9rem;
}
