/* Light & Dark Theme Variables */
:root {
  --bg: #ffffff;
  --bg-secondary: #f4f4f4;
  --card-bg: #ffffff;
  --text: #111111;
  --text-secondary: #555555;
  --text-on-accent: #ffffff;
  --accent-color1: #4F46E5; /* Indigo */
  --accent-color1-darker: #3730A3;
  --accent-color2: #6366f1; /* Lighter purple/blue */
  --border-color: #dddddd;
  --border-color-light: #ddd; /* Specific for navbar light theme */
  --shadow-color-rgba: rgba(0,0,0,0.05);
  --input-bg: #ffffff;
  --input-border: #cccccc;
  --skill-img-bg: #ffffff;
  --skill-img-shadow: rgba(0, 0, 0, 0.1);
  --footer-bg: #0f172a; /* Stays dark */
  --footer-text: #f1f5f9; /* Stays light */
  --footer-border: #475569; /* Stays dark-theme oriented */
  --section-title-color: #222;
  --about-box-h3-color: #333;
  --project-item-h3-color: #333;
  --blog-meta-color: #777;
  --blog-desc-color: #444;
}

.dark-theme {
  --bg: #111111;
  --bg-secondary: #1e1e1e;
  --card-bg: #2a2a2a;
  --text: #ffffff;
  --text-secondary: #aaaaaa;
  /* --text-on-accent: #ffffff; */ /* Usually remains white */
  /* Accents can be adjusted if needed for dark mode, but often work well as is */
  /* --accent-color1: #5a52e8; */
  /* --accent-color1-darker: #4840d3; */
  /* --accent-color2: #7073f3; */
  --border-color: #444444;
  --border-color-light: #333; /* Specific for navbar dark theme */
  --shadow-color-rgba: rgba(255,255,255,0.05);
  --input-bg: #2a2a2a;
  --input-border: #555555;
  --skill-img-bg: #1e1e1e; /* Darker background for skill images */
  --skill-img-shadow: rgba(255, 255, 255, 0.08);
  --section-title-color: #eee;
  --about-box-h3-color: #f0f0f0;
  --project-item-h3-color: #f0f0f0;
  --blog-meta-color: #999;
  --blog-desc-color: #ccc;
}


body {
  margin: 0;
  font-family: 'Segoe UI', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  transition: background-color 0.3s, color 0.3s;
  overflow-x: hidden; /* Moved from global * rule for better specificity */
}

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

html {
  scroll-behavior: smooth;
}

img {
  max-width: 100%;
  height: auto;
}

.container { /* This class was defined but not used in HTML, can be used for centering content */
  width: 90%;
  max-width: 1200px;
  margin: auto;
}


/* 🌐 Navbar */
.navbar {
  width: 100%; /* Changed from 90% to be full width, padding handles spacing */
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background-color: var(--bg);
  color: var(--text);
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid var(--border-color-light); /* Themed border */
}

.logo {
  font-size: 1.5rem;
  font-weight: bold;
  color: var(--text); /* Ensure logo text color changes */
}

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

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

.nav-links li a:hover {
  color: var(--accent-color1); /* Accent color for hover */
}

/* Theme Button */
.theme-toggle button {
  background: none;
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  color: var(--text);
  transition: transform 0.2s;
}

.theme-toggle button:hover {
  transform: scale(1.2);
}

/* Hero Section */
.hero-section {
  padding: 4rem 1rem; /* Added 1rem side padding */
  display: flex;
  justify-content: center;
  background-color: var(--bg); /* Ensure hero background themes */
}

.hero-container {
  width: 85%; /* Adjusted width */
  max-width: 1100px; /* Max width for larger screens */
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
}

.hero-text {
  flex: 1;
  min-width: 280px; /* Prevent too much squishing */
}

.hero-text h1 { /* Was h2 */
  font-size: 2.2rem; /* Adjusted size */
  margin-bottom: 0.5rem;
  color: var(--text);
}

.hero-text h3 {
  font-size: 1.5rem;
  color: var(--accent-color1); /* Themed accent */
  margin-bottom: 1.5rem;
}

.highlight {
  color: var(--accent-color1); /* Themed accent */
}

.hero-buttons {
  display: flex;
  gap: 1rem;
}

.btn, .btn-outline {
  padding: 0.6rem 1.2rem;
  border-radius: 5px;
  text-decoration: none;
  font-weight: 600;
  transition: 0.3s;
}

.btn {
  background-color: var(--accent-color1);
  color: var(--text-on-accent);
}

.btn:hover {
  background-color: var(--accent-color1-darker);
}

.btn-outline {
  border: 2px solid var(--accent-color1);
  color: var(--accent-color1);
}

.btn-outline:hover {
  background-color: var(--accent-color1);
  color: var(--text-on-accent);
}

.hero-image {
  flex: 1;
  text-align: center;
  min-width: 200px; /* Prevent too much squishing */
}

.hero-image img {
  width: 200px; /* Maintain desired size */
  height: 200px; /* Added height for consistency */
  border-radius: 50%; /* Changed to circle, adjust as preferred */
  object-fit: cover;
  border: 3px solid var(--accent-color1); /* Optional themed border */
}

/* Typing Cursor */
.cursor {
  font-weight: 300;
  animation: blink 1s infinite;
  color: var(--text); /* Ensure cursor color themes */
}

@keyframes blink {
  0%, 100% { opacity: 1 }
  50% { opacity: 0 }
}


/* About Section */
.about-section {
  background-color: var(--bg-secondary); /* Themed background */
  padding: 4rem 1rem;
  font-family: 'Segoe UI', sans-serif;
}

.about-container {
  max-width: 1100px;
  margin: 0 auto;
}

.section-title {
  text-align: center;
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 3rem;
  color: var(--section-title-color); /* Themed */
}

.about-row {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center; /* Center boxes if they don't fill row */
}

.about-box {
  background: var(--card-bg); /* Themed */
  padding: 2rem;
  border-radius: 10px;
  box-shadow: 0 4px 12px var(--shadow-color-rgba); /* Themed */
  flex: 1 1 320px; /* Adjusted basis */
  min-width: 280px;
  transition: transform 0.3s, border 0.3s;
  border: 2px solid transparent; /* Prepare for hover border */
}

.about-box:hover {
  border: 2px solid var(--accent-color1);
  transform: translateY(-5px);
}

.about-box h3 {
  font-size: 1.3rem;
  margin-bottom: 1rem;
  color: var(--about-box-h3-color); /* Themed */
}

.about-box p,
.about-box ul {
  font-size: 1rem;
  color: var(--text-secondary); /* Themed */
  line-height: 1.6;
}

.about-box ul {
  padding-left: 1.2rem;
}

/* project section */
.projects-section {
  background-color: var(--bg); /* Themed, maybe primary bg */
  padding: 4rem 1rem;
}

.projects-container {
  max-width: 1100px;
  margin: 0 auto;
}

/* Section-title is already themed */

.project-item {
  background: var(--card-bg); /* Themed */
  border-radius: 12px;
  box-shadow: 0 5px 20px var(--shadow-color-rgba); /* Themed */
  margin-bottom: 2rem;
  padding: 2rem;
  transition: border 0.3s ease, transform 0.3s ease;
  border: 2px solid transparent;
}

.project-item:hover {
  border: 2px solid var(--accent-color1);
  transform: translateY(-5px);
}

.project-content h3 {
  font-size: 1.5rem;
  margin-bottom: 0.8rem;
  color: var(--project-item-h3-color); /* Themed */
}

.project-content p {
  font-size: 1rem;
  color: var(--text-secondary); /* Themed */
  margin-bottom: 0.8rem;
  line-height: 1.6;
}

.project-buttons {
  display: flex;
  gap: 1rem;
  margin-top: 1rem;
}

.project-buttons a {
  background-color: var(--accent-color1);
  color: var(--text-on-accent);
  padding: 0.5rem 1rem;
  text-decoration: none;
  border-radius: 5px;
  font-size: 0.95rem;
  transition: background 0.3s;
}

.project-buttons a:hover {
  background-color: var(--accent-color1-darker);
}


/* skill section  */
.skills-block-section {
  /* background: url(../image/background.jpg); Optional: consider how this image works with dark theme */
  width: 90%;
  margin: 2rem auto; /* Centered with margin */
  padding: 4rem 1rem;
  background-color: var(--bg-secondary); /* Themed */
  text-align: center;
  border-radius: 10px; /* Optional rounding */
}

.skills-title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--section-title-color); /* Themed */
  margin-bottom: 2.5rem;
  position: relative;
  display: inline-block;
}

.skills-title span {
  position: relative;
}

.skills-title span::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 4px;
  background: var(--accent-color2); /* Themed */
  border-radius: 2px;
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 2rem;
  justify-items: center;
}

.skills-grid img {
  width: 80px;
  height: 80px;
  object-fit: contain;
  background: var(--skill-img-bg); /* Themed */
  padding: 1rem;
  border-radius: 12px;
  box-shadow: 0 6px 15px var(--skill-img-shadow); /* Themed */
  transition: transform 0.3s, box-shadow 0.3s;
}

.skills-grid img:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px var(--skill-img-shadow); /* Themed */
}

/* Blog section  */
.blog-section {
  padding: 4rem 1rem;
  background: var(--bg); /* Themed */
  text-align: center;
}

.blog-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 3rem;
  color: var(--section-title-color); /* Themed */
}

.blog-title span {
  position: relative;
}

.blog-title span::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--accent-color2); /* Themed */
  border-radius: 2px;
}

.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  justify-items: center;
  max-width: 1100px; /* Container for blog cards */
  margin: 0 auto;
}

.blog-card {
  background: var(--card-bg); /* Themed */
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 15px var(--shadow-color-rgba); /* Themed */
  max-width: 380px;
  text-align: left;
  transition: transform 0.3s;
  border: 1px solid var(--border-color); /* Subtle border */
}

.blog-card:hover {
  transform: translateY(-5px);
  border-color: var(--accent-color2);
}

.blog-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.blog-content {
  padding: 1rem 1.2rem;
}

.blog-content h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text); /* Themed */
}

.blog-meta {
  font-size: 0.875rem;
  color: var(--blog-meta-color); /* Themed */
  margin-bottom: 1rem;
}

.blog-meta span {
  color: var(--accent-color2); /* Themed */
}

.blog-desc {
  font-size: 0.95rem;
  color: var(--blog-desc-color); /* Themed */
  margin-bottom: 1rem;
}

.blog-button {
  display: inline-block;
  padding: 0.5rem 1rem;
  background: var(--accent-color2);
  color: var(--text-on-accent);
  text-decoration: none;
  border-radius: 6px;
  font-size: 0.9rem;
  transition: background 0.3s;
}

.blog-button:hover {
  background: var(--accent-color1); /* Using other accent for hover */
}

/* Contact Section */
.contact-section {
  padding: 4rem 1rem;
  background: var(--bg-secondary); /* Themed */
  text-align: center;
}

.contact-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 2rem;
  color: var(--section-title-color); /* Themed */
}

.contact-title span {
  position: relative;
}

.contact-title span::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--accent-color2); /* Themed */
  border-radius: 2px;
}

.contact-form {
  max-width: 600px;
  margin: 0 auto 2rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.contact-form input,
.contact-form textarea {
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border: 1px solid var(--input-border); /* Themed */
  border-radius: 8px;
  outline: none;
  background: var(--input-bg); /* Themed */
  color: var(--text); /* Themed for input text */
}

.contact-form button {
  padding: 0.75rem;
  background: var(--accent-color2);
  color: var(--text-on-accent);
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
}

.contact-form button:hover {
  background: var(--accent-color1);
}

.social-links {
  margin-top: 2rem;
  display: flex;
  justify-content: center;
  gap: 1.5rem;
}

.social-links img { /* Assuming these are SVGs or PNGs that might need filter for dark mode if they are dark icons */
  width: 40px;
  height: 40px;
  transition: transform 0.3s;
}
/* If social icons are dark and don't show well in dark mode, you might need:
.dark-theme .social-links img {
  filter: invert(1) brightness(1.5);
} */

.social-links img:hover {
  transform: scale(1.2);
}

/* Footer */
.footer-section {
  background-color: var(--footer-bg); /* Specific footer bg */
  color: var(--footer-text); /* Specific footer text */
  padding: 2rem 1rem;
  text-align: center;
}

.footer-content h3 { /* This class was empty in HTML, styling for completeness */
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
  color: var(--footer-text);
}

.footer-content p { /* This class was empty in HTML, styling for completeness */
  font-size: 0.95rem;
  margin-bottom: 1rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
  color: var(--footer-text);
}

.footer-socials { /* This class was empty in HTML, styling for completeness */
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  gap: 1.2rem;
}

.footer-socials img {
  width: 30px;
  height: 30px;
  transition: transform 0.3s ease;
}
/* .dark-theme .footer-socials img { filter: none; } /* Ensure footer icons are not inverted if global rule exists */


.footer-socials img:hover {
  transform: scale(1.2);
}

.footer-bottom {
  margin-top: 2rem;
  font-size: 0.85rem;
  border-top: 1px solid var(--footer-border); /* Specific footer border */
  padding-top: 1rem;
  color: var(--footer-text);
}


/* Responsive Styles */

/* Navbar Hamburger (Open) Button */
.navbar-open {
  display: none;
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--text); /* Themed */
  cursor: pointer;
  position: absolute; /* Kept absolute to be relative to navbar */
  right: 1.5rem; /* Common position for hamburger */
  top: 50%;
  transform: translateY(-50%);
  z-index: 1101;
}

/* Navbar Close Button */
.navbar-close {
  display: none; /* Hidden by default, shown in JS when nav is open */
  background: none;
  border: none;
  font-size: 2rem;
  color: var(--text); /* Themed */
  cursor: pointer;
  position: absolute;
  top: 1rem;
  right: 1.5rem;
  z-index: 1102; /* Above nav links */
}

@media (max-width: 900px) {
  .navbar {
    padding: 1rem; /* Adjust padding */
    /* flex-direction: column; Removed, handled by nav-links display */
    /* align-items: flex-start; Removed */
  }

  .logo {
    flex-grow: 1; /* Allow logo to take available space */
  }

  .navbar-open {
    display: block; /* Show hamburger */
  }

  .nav-links {
    display: none; /* Hidden by default on mobile */
    flex-direction: column;
    position: fixed; /* Full screen overlay */
    top: 0;
    right: -100%; /* Start off-screen */
    background: var(--bg); /* Themed */
    height: 100vh;
    width: 70vw;
    max-width: 300px; /* Max width of menu */
    box-shadow: -2px 0 12px var(--shadow-color-rgba); /* Themed */
    padding-top: 3.5rem; /* Space for close button */
    z-index: 1100;
    transition: right 0.3s ease-in-out; /* Smooth transition */
    gap: 1.5rem; /* Spacing for links */
    align-items: center; /* Center links */
  }

  .nav-links.open {
    display: flex; /* Show when .open class is added */
    right: 0; /* Slide in */
  }

  .navbar-close {
    display: block; /* Always visible inside open mobile menu */
  }

  .theme-toggle { /* Reposition theme toggle if needed on mobile */
     margin-left: auto; /* Push it to the right of logo if open button on left */
     padding-right: 3.5rem; /* Space for open button */
  }
   .navbar-open {
    left: 1.5rem; /* Position hamburger on the left */
    right: auto;
  }

  .theme-toggle {
      position: absolute;
      right: 1.5rem;
      top: 50%;
      transform: translateY(-50%);
      padding-right: 0; /* Reset padding */
  }
  .navbar-open {
      position: static; /* Simpler positioning if theme toggle is absolute */
      transform: none;
      order: -1; /* Place hamburger before logo if needed or adjust layout */
      margin-right:1rem;
  }
   .logo { text-align: center; flex-grow:1;}


  .hero-container,
  .about-row {
    flex-direction: column;
    align-items: center;
    gap: 2rem;
    width: 95%; /* More padding for content */
  }
  .hero-text h1 { font-size: 2rem;}
  .hero-text h3 { font-size: 1.3rem;}


  .skills-block-section {
    margin-left: auto; /* Center with auto margins */
    margin-right: auto;
    width: 95%;
    padding: 2rem 1rem;
  }
  .container {
    width: 95%;
    padding: 0 1rem;
  }
  .projects-section,
  .about-section,
  .blog-section,
  .contact-section,
  .footer-section {
    padding: 3rem 1rem;
  }
}


/* Mobile devices */
@media (max-width: 600px) {
  .navbar {
    padding: 1rem;
  }
  .nav-links {
    gap: 1rem;
    padding-top: 4rem;
  }

  .hero-section {
    padding: 2.5rem 1rem;
  }
  .hero-container {
    gap: 1.5rem;
  }
  .hero-text h1 { font-size: 1.8rem; }
  .hero-text h3 { font-size: 1.2rem; }


  .section-title,
  .skills-title,
  .blog-title,
  .contact-title {
    font-size: 2rem;
  }

  .skills-grid img {
    width: 70px;
    height: 70px;
  }
  .blog-card img {
    height: 180px;
  }

  .about-box {
    min-width: auto; /* Allow full stretch */
    flex-basis: 100%;
    padding: 1.5rem;
  }
  .blog-card {
    max-width: 100%;
  }
  .contact-form {
    padding: 0 0.5rem;
  }
}

/* Small mobile devices */
@media (max-width: 400px) {
  .hero-text h1 {
    font-size: 1.6rem;
  }
  .hero-text h3 {
    font-size: 1.1rem;
  }
  .btn, .btn-outline {
    padding: 0.5rem 0.8rem;
    font-size: 0.9rem;
  }
  .skills-grid img {
    width: 60px;
    height: 60px;
  }
  .section-title,
  .skills-title,
  .blog-title,
  .contact-title {
    font-size: 1.8rem;
  }
}