/* =========================================
   1. VARIABLES & RESET
   ========================================= */
:root {
  /* Dark Mode (Default) */
  --bg-color: #0d1117;
  --card-bg: #161b22;
  --text-main: #e6edf3;
  --text-dim: #8b949e;
  --accent-purple: #8957e5;
  --accent-blue: #2f81f7;
  --accent-green: #238636;
  --border-color: #30363d;
  --code-box-bg: #010409;
  --font-family: 'Inter', sans-serif;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Light Mode Overrides */
body.light-theme {
  --bg-color: #ffffff;
  --card-bg: #f6f8fa;
  --text-main: #1f2328;
  --text-dim: #57606a;
  --accent-purple: #6e40c9;
  --accent-blue: #0969da;
  --border-color: #d0d7de;
  /*--code-box-bg: #f6f8fa;*/
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  background-color: var(--bg-color);
  color: var(--text-main);
  font-family: var(--font-family);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* =========================================
   2. NAVBAR
   ========================================= */
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 5%;
  position: sticky;
  top: 0;
  background: rgba(13, 17, 23, 0.8);
  backdrop-filter: blur(12px);
  z-index: 1000;
  border-bottom: 1px solid var(--border-color);
}

body.light-theme .navbar {
  background: rgba(255, 255, 255, 0.8);
}

.logo {
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.5px;
}

.purple { color: var(--accent-purple); }

.nav-links {
  display: flex;
  list-style: none;
  gap: 2rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-dim);
  font-weight: 500;
  transition: var(--transition);
}

.nav-links a:hover, .nav-links li.active a {
  color: var(--accent-purple);
}

.theme-toggle {
  cursor: pointer;
  font-size: 1.2rem;
  user-select: none;
  padding: 5px;
}
/* Styling for the current section's link */
.nav-links li.active a {
  color: var(--accent-purple);
  position: relative;
}

/* Optional: Add a small underline effect for the active link */
.nav-links li.active a::after {
  content: '';
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--accent-purple);
  transition: var(--transition);
}

/* =========================================
   3. HERO SECTION (ABOUT)
   ========================================= */
.about {
  display: flex;
  min-height: 85vh;
  padding: 4rem 10%;
  align-items: center;
  gap: 4rem;
}

.about .left { flex: 1.2; }
.about .right { flex: 0.8; }

h1 { font-size: 3rem; line-height: 1.1; margin-bottom: 1.5rem; }
.big { font-size: 4rem; display: block; }

/* Terminal Code Box */



/* Update your existing code-box/json-box CSS */
.code-box, .json-box {
  /* Use a hardcoded dark color instead of a variable that changes */
  background: #010409 !important; 
  border: 1px solid #30363d;
  border-radius: 8px;
  padding: 1.5rem;
  font-family: 'Courier New', monospace;
  box-shadow: 0 20px 40px rgba(0,0,0,0.3);
}

/* Ensure the text inside PRE stays light even in Light Mode */
.code-box pre, .json-box pre {
  color: #d1d5db !important; /* Forces light grey text */
}

/* Ensure the JSON keys/values stay bright */
.json-box {
    color: #d1d5db; /* Light blue for JSON look */
}

.dots { display: flex; gap: 8px; margin-bottom: 1rem; }
.dots span { width: 12px; height: 12px; border-radius: 50%; }
.red { background: #ff5f56; }
.yellow { background: #ffbd2e; }
.green { background: #27c93f; }

pre { 
  color: var(--text-main); 
  font-size: 0.9rem; 
  white-space: pre-wrap; 
}

/* Socials & Buttons */
.buttons { display: flex; gap: 1rem; margin: 2rem 0; }
button {
  padding: 0.8rem 1.8rem;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  transition: var(--transition);
  border: none;
}

.primary { background: var(--accent-purple); color: white; }
.secondary { background: transparent; border: 1px solid var(--accent-purple); color: var(--text-main); }
button:hover { transform: translateY(-3px); box-shadow: 0 5px 15px rgba(137, 87, 229, 0.4); }

.socials {
  display: flex;
  gap: 1.2rem;
  margin-top: 2rem;
}

.social-icon {
  width: 22px;
  height: 22px;
  color: var(--text-dim);
  transition: transform 0.3s ease, color 0.3s ease;
}

.socials a {
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  text-decoration: none;
  
  /* The Glass Effect */
  background: rgba(255, 255, 255, 0.03); 
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* --- HOVER STATE --- */
.socials a:hover {
  background: var(--accent-purple);
  border-color: var(--accent-purple);
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(137, 87, 229, 0.4);
  filter: drop-shadow(0 0 10px rgba(137, 87, 229, 0.8));
}

.socials a:hover .social-icon {
  color: #fff; /* Icon turns white when background turns purple */
  transform: scale(1.1);
}

/* --- LIGHT THEME ADJUSTMENT --- */
body.light-theme .socials a {
  background: rgba(0, 0, 0, 0.05);
  border-color: rgba(0, 0, 0, 0.1);
}

body.light-theme .socials a:hover {
  background: var(--accent-purple);
}
/* =========================================
   4. ABOUT DETAILS (PROFILE)
   ========================================= */
.about-details { padding: 5rem 10%; border-top: 1px solid var(--border-color); }

.section-title {
  text-align: center;
  font-size: 2.2rem;
  margin-bottom: 3rem;
}

.section-title span { color: var(--accent-purple); font-family: monospace; }

.about-container {
  display: flex;
  align-items: center;
  gap: 4rem;
  max-width: 1000px;
  margin: 0 auto;
}

.profile-card img {
  width: 200px;
  height: 200px;
  border-radius: 20px;
  border: 4px solid var(--accent-purple);
  object-fit: cover;
}

.about-text p { margin-bottom: 1rem; font-size: 1.1rem; color: var(--text-dim); }

.resume-btn { background: var(--accent-blue); color: white; margin-top: 1rem; }



/* =========================================
   5. PROJECTS GRID
   ========================================= */
.projects { padding: 5rem 10%; background: var(--card-bg); }

.projects-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 2rem;
}

.project-card {
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  transition: var(--transition);
}

.project-card:hover { transform: translateY(-10px); border-color: var(--accent-purple); }

.project-image {
  height: 180px;
  background: linear-gradient(45deg, #1e1e2f, #3a3a5a);
}

.project-content { padding: 1.5rem; }
.project-content h3 { margin-bottom: 1rem; color: var(--accent-purple); }

.tech-stack { display: flex; flex-wrap: wrap; gap: 8px; margin: 1rem 0; }
.tech-stack span {
  background: var(--card-bg);
  padding: 4px 10px;
  border-radius: 4px;
  font-size: 0.75rem;
  color: var(--accent-blue);
}

.project-buttons { display: flex; gap: 10px; margin-top: 1.5rem; }
.code-btn, .demo-btn { padding: 0.5rem 1rem; font-size: 0.85rem; flex: 1; }
.code-btn { background: #21262d; color: white; }
.demo-btn { background: var(--accent-purple); color: white; }

/* =========================================
   6. SKILLS & CERTIFICATES
   ========================================= */
.skills, .certificates { padding: 5rem 10%; }

.skills-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.skill-card{
  background: var(--card-bg);
  padding: 2rem;
  border-radius: 12px;
  border: 1px solid var(--border-color);
  transition: var(--transition);
}

.skill-card:hover { border-color: var(--accent-blue); }



/* --- ENHANCED CERTIFICATES SECTION --- */

.cert-container {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  padding: 2rem 0;
}

.cert-card {
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  padding: 2rem;
  border-radius: 16px;
  display: flex;
  flex-direction: column; /* This is key for alignment */
  transition: var(--transition);
  height: 100%; /* Ensures all cards in a row are same height */
}

.cert-card:hover {
  transform: translateY(-8px);
  border-color: var(--accent-purple);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.cert-date {
  font-size: 0.85rem;
  color: var(--accent-purple);
  font-weight: 700;
  margin-bottom: 0.5rem;
}

.cert-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.issuer {
  font-size: 0.95rem;
  color: var(--text-dim);
  margin-bottom: 1rem;
}

.cert-desc {
  font-size: 0.9rem;
  color: var(--text-dim);
  margin-bottom: 1.5rem;
  flex-grow: 1; /* This pushes everything below it to the bottom */
}

/* --- TAGS ENHANCEMENT --- */
.cert-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 2rem;
}

.cert-tags span {
  background: rgba(137, 87, 229, 0.1); /* Subtle purple tint */
  color: var(--accent-purple);
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.7rem;
  font-weight: 600;
  border: 1px solid rgba(137, 87, 229, 0.2);
}

/* --- THE FIXED BUTTON --- */
.cert-btn {
  width: 100%;
  padding: 12px;
  background: var(--accent-purple);
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
  display: block;
  margin-top: auto; /* Forces button to the bottom */
}

.cert-btn:hover {
  background: #7a46d1;
  box-shadow: 0 0 15px rgba(137, 87, 229, 0.4);
  transform: scale(1.02);
}

/* Light Theme Adjustment */
body.light-theme .cert-tags span {
  background: #f0f0f0;
  color: #555;
}



/* SKILLS FILTER TABS */
.skills-tabs {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 3rem;
  flex-wrap: wrap;
}

.tab {
  background: var(--card-bg);
  color: var(--text-dim);
  border: 1px solid var(--border-color);
  padding: 8px 20px;
  border-radius: 50px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: var(--transition);
}

.tab:hover {
  border-color: var(--accent-purple);
  color: var(--text-main);
}

.tab.active {
  background: var(--accent-purple);
  color: white;
  border-color: var(--accent-purple);
}

/* Smooth transition when cards disappear */
.skill-card {
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* =========================================
   7. CONTACT FORM
   ========================================= */
.contact { padding: 5rem 10%; }
.contact-container { max-width: 600px; margin: 0 auto; }
.contact-card { background: var(--card-bg); padding: 2.5rem; border-radius: 15px; border: 1px solid var(--border-color); }

form label { display: block; margin-top: 1rem; font-weight: 600; font-size: 0.9rem; }
form input, form textarea {
  width: 100%; padding: 12px; margin-top: 5px;
  background: var(--bg-color); border: 1px solid var(--border-color);
  border-radius: 6px; color: var(--text-main); outline: none;
}
form input:focus { border-color: var(--accent-purple); }

.contact-btn { width: 100%; margin-top: 2rem; background: var(--accent-purple); color: white; }

/* =========================================
   8. FOOTER & TOAST
   ========================================= */
.footer { padding: 2rem 10%; border-top: 1px solid var(--border-color); text-align: center; }
.footer-container { display: flex; justify-content: space-between; font-size: 0.9rem; color: var(--text-dim); }

.toast {
  position: fixed; bottom: -100px; left: 50%; transform: translateX(-50%);
  background: var(--accent-green); color: white; padding: 1rem 2rem;
  border-radius: 50px; transition: 0.5s; z-index: 2000;
}
.toast.show { bottom: 30px; }

/* =========================================
   9. MOBILE RESPONSIVENESS
   ========================================= */
@media (max-width: 992px) {
  .about { flex-direction: column; text-align: center; padding-top: 2rem; }
  .big { font-size: 3rem; }
  .about-container { flex-direction: column; text-align: center; }
  .nav-links { display: none; } /* Standard for mobile - usually a menu icon goes here */
}

@media (max-width: 600px) {
  .buttons { flex-direction: column; }
  .section-title { font-size: 1.8rem; }
  .footer-container { flex-direction: column; gap: 10px; }
}