/* ===================== ROOT VARIABLES ===================== */
:root {
  --main-bg: #f3f4f6;
  --card-bg: #ffffff;
  --primary: #20c997;
  --accent: #e65c4f;
  --badge-hover: #ff715b;
  --heading: #232946;
  --shadow: 0 4px 20px rgba(32,201,151,0.10);
  --radius: 14px;
  --font-main: 'Segoe UI', Arial, sans-serif;
}

/* ===================== DARK MODE ===================== */
body.dark-mode {
  --main-bg: #1e2332;
  --card-bg: #21253a;
  --primary: #20c997;
  --accent: #c96cd7;
  --badge-hover: #c96cd7;
  --heading: #edeeff;
}
body.dark-mode section { box-shadow: 0 4px 22px #20c99718; }
body.dark-mode footer { background: #21253a; color: #ccc; }
body.dark-mode nav a { color: #edeeff; }
body.dark-mode .badge { color: #fff; }
body.dark-mode .mode-toggle {
  background: #232946;
  color: #fff;
  border-color: #20c997;
}

/* ===================== BASE ===================== */
body {
  background: var(--main-bg);
  color: var(--heading);
  font-family: var(--font-main);
  margin: 0;
  padding: 0;
  transition: background 0.25s, color 0.25s;
}

section {
  background: var(--card-bg);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin: 2.5rem auto;
  max-width: 680px;
  padding: 2.2rem;
  transition: box-shadow .25s, transform .2s;
}
section[data-aos] { will-change: opacity, transform; }

h3 {
  color: var(--heading);
  border-bottom: 1.5px solid #eee;
  padding-bottom: 0.7rem;
  margin-bottom: 1.2rem;
  font-size: 1.35em;
  letter-spacing: 0.05em;
}
h4 { color: var(--accent); margin-bottom: 0.6em; }

/* ===================== HEADER & NAV ===================== */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--card-bg);
  padding: 2rem 2.5rem 1rem;
  border-bottom: 1px solid #e9e9ea;
  box-shadow: var(--shadow);
}
.header-left h1 {
  font-size: 2.3rem;
  font-weight: 800;
}
.header-left h2 {
  font-size: 1.1rem;
  color: #666;
  margin-top: 0.3rem;
}

.avatar {
  width: 62px;
  height: 62px;
  border: 2.5px solid var(--primary);
  border-radius: 50%;
  box-shadow: 0 4px 18px rgba(32,201,151,0.10);
  transition: transform .25s ease, box-shadow .25s ease;
}
.avatar:hover { transform: scale(1.08); box-shadow: 0 10px 28px #20c99733; }

nav { display: flex; gap: 1.4rem; }
nav a {
  font-weight: 600;
  font-size: 1.1em;
  color: var(--heading);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color .2s, border-bottom .2s;
}
nav a:hover, nav a.active { color: var(--primary); border-bottom: 2px solid var(--primary); }

/* Mode Button (JS Added) */
.mode-toggle {
  border: 1.5px solid #ebecf0;
  border-radius: 50%;
  padding: 3px 10px;
  margin-left: 1rem;
  background: #fff;
  box-shadow: 0 2px 10px #ddd;
  cursor: pointer;
  font-size: 1.3em;
  transition: background .2s, transform .2s;
}
.mode-toggle:hover { transform: scale(1.1); }

/* ===================== BADGES ===================== */
.skill-badge { margin-bottom: 1.6rem; }
.badge {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  border-radius: 20px;
  padding: 0.5em 1em;
  margin: 4px 6px;
  box-shadow: 0 3px 10px rgba(32,201,151,0.15);
  transition: transform .2s, background .2s, box-shadow .2s;
}
.badge:hover {
  background: var(--badge-hover);
  transform: scale(1.08);
  box-shadow: 0 8px 24px var(--badge-hover);
}

/* ===================== JS TESTER ===================== */
#jsinput {
  width: 100%;
  height: 70px;
  border-radius: 8px;
  border: 1.5px solid #ccc;
  background: #fff;
  padding: 0.6rem;
  font-family: 'Fira Mono','Consolas', monospace;
  box-shadow: 0 1px 10px rgba(0,0,0,0.05);
}
#jsoutput {
  background: #232946;
  color: #eee;
  padding: 0.75rem;
  border-radius: 10px;
  margin-top: 0.8rem;
  min-height: 2rem;
  font-family: 'Fira Mono','Consolas', monospace;
}

/* ===================== COUNTER ===================== */
.animated-counter {
  text-align: center;
  margin: 1.5rem 0;
  color: var(--heading);
  font-size: 1.1em;
}
#counter { font-size: 2em; color: var(--primary); font-weight: 800; }
#countBtn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 5px 12px;
  font-weight: 600;
  cursor: pointer;
  transition: transform .2s, background .2s;
}
#countBtn:hover {
  background: var(--badge-hover);
  transform: scale(1.1);
}

/* ===================== BUTTON DESIGNER ===================== */
#styledBtn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 10px 24px;
  font-size: 1.1em;
  font-weight: 650;
  cursor: pointer;
  transition: background .2s, transform .2s, box-shadow .2s;
  box-shadow: 0 2px 14px rgba(230,92,79,0.25);
}
#styledBtn:hover { background: var(--badge-hover); transform: scale(1.1); box-shadow: 0 8px 30px #e65c4f55; }

/* ===================== COLOR MIXER ===================== */
#colorBox {
  height: 52px;
  border: 1px solid #ddd;
  border-radius: 10px;
  transition: background .3s, box-shadow .25s;
}
#colorBox:hover { box-shadow: 0 0 18px rgba(32,201,151,0.25); }
#rgbVals {
  margin-top: 0.6rem;
  font-family: monospace;
  color: var(--heading);
  font-weight: bold;
  font-size: 1.1em;
}

/* ===================== QUIZ ===================== */
button[onclick^="quizAnswer"] {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 9px;
  padding: 7px 15px;
  margin-right: 6px;
  margin-top: 0.5rem;
  cursor: pointer;
  font-weight: 600;
  transition: background .2s, transform .2s;
}
button[onclick^="quizAnswer"]:hover {
  background: var(--accent);
  transform: scale(1.08);
  box-shadow: 0 8px 24px rgba(230,92,79,0.25);
}

/* ===================== PROJECTS ===================== */
#projectList {
  list-style: none;
  padding: 0;
}
#projectList li {
  padding: 1em;
  border-left: 6px solid var(--primary);
  background: #f7fafc;
  margin: 1rem 0;
  border-radius: 10px;
  box-shadow: 0 3px 12px rgba(32,201,151,0.12);
  transition: transform .2s, box-shadow .2s, background .2s;
}
#projectList li:hover {
  transform: translateX(4px) scale(1.03);
  background: #e7f9f7;
  box-shadow: 0 8px 25px rgba(32,201,151,0.2);
}

/* ===================== CONTACT FORM ===================== */
#contactForm input, #contactForm textarea {
  width: 100%;
  background: #f8f9fa;
  border: 1px solid #ccc;
  border-radius: 10px;
  margin-top: 8px;
  padding: 10px;
  transition: border .2s, box-shadow .2s;
}
#contactForm input:focus, #contactForm textarea:focus {
  border: 1.5px solid var(--primary);
  outline: none;
  box-shadow: 0 2px 10px rgba(32,201,151,0.25);
}
#contactForm button {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 10px 24px;
  cursor: pointer;
  font-weight: 600;
  transition: background .2s, transform .2s;
}
#contactForm button:hover {
  background: var(--badge-hover);
  transform: scale(1.05);
}
.feedback {
  margin-top: 8px;
  font-weight: bold;
}

/* ===================== FOOTER ===================== */
footer {
  text-align: center;
  background: var(--card-bg);
  padding: 1.4rem 0;
  border-top: 1px solid #eee;
  font-size: 1rem;
  color: #556;
}

/* ===================== RIPPLE EFFECT ===================== */
button {
  position: relative;
  overflow: hidden;
}
.ripple {
  position: absolute;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(32,201,151,0.3);
  pointer-events: none;
  transform: scale(0);
  animation: ripple-ani .55s linear;
}
@keyframes ripple-ani {
  to { transform: scale(2.5); opacity: 0; }
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 900px) {
  header { flex-direction: column; text-align: center; gap: 1rem; }
  nav { justify-content: center; flex-wrap: wrap; gap: 1rem; }
  .avatar { width: 52px; height: 52px; }
}
@media (max-width:600px) {
  section { padding: 1.1rem; margin: 1.2rem; }
  .avatar { width: 46px; height: 46px; }
  .header-left h1 { font-size: 1.5rem; }
  .header-left h2 { font-size: 1rem; }
  nav a { font-size: 1rem; }
}
