/* --- Variables & Reset --- */
:root {
  --primary-color: #6366f1;
  --text-main: #f8fafc;
  --bg-glass: rgba(15, 23, 42, 0.8);
  --transition: all 0.3s ease;
}

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

/* --- Global Background & Layout --- */
body {
  background-color: #0a0a0a;
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* Subtle background glow for depth */
body::before {
  content: "";
  position: absolute;
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, rgba(0, 255, 204, 0.05) 0%, rgba(0, 0, 0, 0) 70%);
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: -1;
  pointer-events: none;
}

/* --- Navigation Bar --- */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  z-index: 1000;
  background: var(--bg-glass);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.nav-logo {
  font-size: 1.5rem;
  font-weight: 800;
  text-decoration: none;
  color: var(--text-main);
}

.code-bracket {
  color: var(--primary-color);
}

.nav-menu {
  display: flex;
  list-style: none;
  gap: 2.5rem;
}

/* --- Optimized Navigation Links --- */
/* --- Navigation Links (Same in ALL files) --- */
.nav-link {
  display: inline-block;
  padding: 0.5rem 0; /* Remove horizontal padding, handled by min-width */
  min-width: 100px;  /* Forces every button box to be the exact same width */
  text-align: center;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 600; 
  
  /* The "Invisible Box" skeleton */
  border: 1px solid transparent; 
  background: transparent;
  
  color: var(--text-main);
  opacity: 0.7;
  transition: all 0.3s ease;
}

/* --- Hover State --- */
.nav-link:not(.active):hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* --- The Active State (Standardized) --- */
.nav-link.active {
  opacity: 1 !important;
  color: var(--primary-color) !important;
  background: rgba(99, 102, 241, 0.1); 
  border: 1px solid var(--primary-color) !important; 
  box-shadow: 0 0 15px rgba(99, 102, 241, 0.15);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.btn-cta {
  background: var(--primary-color);
  color: white;
  padding: 0.6rem 1.2rem;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: var(--transition);
}

.btn-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* --- Projects Section --- */
.projects-container {
  max-width: 1200px;
  margin: 100px auto; /* Space for fixed navbar */
  padding: 0 2rem;
}

.section-title {
  margin-bottom: 2rem;
  font-size: 2.5rem;
  text-align: center;
}

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

/* --- Project Card --- */
.project-card {
  background: rgba(255, 255, 255, 0.03); /* Subtle contrast */
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px; /* Rounded corners */
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3); /* Depth shadow */
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 40px rgba(99, 102, 241, 0.2); /* Subtle primary glow */
  background: rgba(255, 255, 255, 0.05);
}

.project-image {
  width: 100%;
  height: 200px;
  object-fit: cover; /* Keeps image from stretching */
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.project-content {
  padding: 1.5rem;
}

.project-title {
  margin-bottom: 0.8rem;
  color: var(--primary-color);
  font-size: 1.4rem;
}

.project-description {
  font-size: 0.95rem;
  line-height: 1.6;
  opacity: 0.8;
}

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

/* Ensure the title and GitHub icon stay on the same line */
.project-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.8rem;
}

/* Make sure the title link doesn't look like a standard blue link */
.project-title-link {
  text-decoration: none;
  color: inherit;
}

.project-title-link:hover .project-title {
  text-decoration: underline;
}

/* Style the source code icon */
.source-code-link svg {
  fill: var(--text-main);
  transition: var(--transition);
  opacity: 0.7;
}

.source-code-link:hover svg {
  fill: var(--primary-color);
  opacity: 1;
  transform: scale(1.1);
}

/* Keep the card's general look even though it's now a div */
.project-card {
  cursor: default; /* Change to default since only parts are clickable */
}

/* --- Responsive Fix --- */
@media (max-width: 768px) {
  .nav-menu {
    display: none;
  }
}