/* ==============================================
    CSS Variables for Theming
    ==============================================
    */
:root {
  /* Dark Theme Colors */
  --bg: #0b0d12;
  --surface: #121622;
  --text: #eef2ff;
  --muted: #a7b0c0;
  --brand: #7c5cff; /* purple accent */
  --brand-2: #31e1c0; /* teal accent */
  --card: rgba(255, 255, 255, 0.06);
  --glass: rgba(255, 255, 255, 0.08);
  --border: rgba(255, 255, 255, 0.12);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --grad: radial-gradient(
      1200px 600px at 20% -10%,
      #7c5cff33,
      transparent 60%
    ),
    radial-gradient(900px 500px at 120% 20%, #31e1c033, transparent 60%);
}

.light-theme {
  /* Light Theme Colors */
  --bg: #f0f2f5;
  --surface: #ffffff;
  --text: #1c1e21;
  --muted: #606770;
  --brand: #7c5cff;
  --brand-2: #1db99a;
  --card: #ffffff;
  --glass: rgba(0, 0, 0, 0.05);
  --border: rgba(0, 0, 0, 0.1);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  --grad: radial-gradient(
      1200px 600px at 20% -10%,
      #7c5cff1a,
      transparent 60%
    ),
    radial-gradient(900px 500px at 120% 20%, #31e1c01a, transparent 60%);
}

/* ==============================================
    Global Styles & Resets
    ==============================================
    */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html {
  scroll-behavior: smooth;
}
body {
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Helvetica,
    Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
}
body.modal-open {
  overflow: hidden;
}

/* ==============================================
    Header & Navigation
    ==============================================
    */
header {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s, border-bottom 0.3s;
}
.nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.6px;
  color: var(--text);
  text-decoration: none;
}
.brand .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 0 16px #7c5cffaa;
}
.brand span {
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
nav ul {
  display: flex;
  gap: 18px;
  list-style: none;
}
nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  padding: 8px 10px;
  border-radius: 10px;
  transition: 0.25s;
}
nav a:hover,
nav a.active {
  color: var(--text);
  background: var(--glass);
}
.actions {
  display: flex;
  gap: 10px;
  align-items: center;
}
.btn {
  border: none;
  padding: 10px 14px;
  border-radius: 12px;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  box-shadow: var(--shadow);
  transition: 0.25s;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 35px rgba(0, 0, 0, 0.4);
}
.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}
.theme {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: 0.25s;
}
.theme:hover {
  background: var(--glass);
}
.hamburger {
  display: none; /* Hidden by default */
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 18px;
  cursor: pointer;
}
.mobile-menu {
  display: none; /* Hidden by default */
  flex-direction: column;
  gap: 8px;
  padding: 10px 20px 18px;
  border-top: 1px solid var(--border);
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(10px);
}
.mobile-menu a {
  padding: 10px;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  transition: 0.25s;
}
.mobile-menu a:hover,
.mobile-menu a.active {
  color: var(--text);
  background: var(--glass);
}
.mobile-menu.active {
  display: flex; /* Show when active */
}

/* ==============================================
    Hero Section
    ==============================================
    */
.hero {
  position: relative;
  isolation: isolate;
  min-height: 92vh;
  display: grid;
  place-items: center;
  padding: 120px 20px 80px;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -20vh -10vw;
  background: var(--grad);
  z-index: -1;
  transition: background 0.3s;
}
.container {
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 40px;
  align-items: center;
}
.title {
  font-size: clamp(28px, 4.5vw, 56px);
  line-height: 1.1;
  font-weight: 800;
  margin: 0 0 12px;
  letter-spacing: -0.5px;
}
.title .accent {
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.subtitle {
  color: var(--muted);
  font-size: clamp(14px, 1.5vw, 18px);
  margin-bottom: 22px;
  max-width: 500px;
}
.typewrap {
  font-weight: 700;
  font-size: clamp(16px, 2vw, 22px);
  margin: 14px 0 26px;
  color: var(--text);
}
.typewrap .cursor {
  margin-left: 4px;
  opacity: 0.8;
  animation: blink 0.7s infinite;
}
@keyframes blink {
  50% {
    opacity: 0;
  }
}
.cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}
.card-hero {
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 12px;
  background: var(--card);
  display: flex;
  align-items: center;
  gap: 12px;
  width: max-content;
  transition: background 0.3s, border 0.3s;
}
.avatar {
  width: 150px; /* Increased size */
  height: 150px; /* Increased size */
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  flex-shrink: 0;
}
.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ==============================================
    General Section Styling
    ==============================================
    */
section {
  padding: 90px 20px;
}
.section-title {
  font-size: clamp(22px, 3vw, 36px);
  margin: 0 0 12px;
  font-weight: 800;
  letter-spacing: -0.3px;
}
.section-sub {
  color: var(--muted);
  margin-bottom: 28px;
}

/* ==============================================
    About Section
    ==============================================
    */
.about-grid {
  max-width: 1100px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 28px;
}
.professional-summary h3 {
  font-size: 22px;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}
.professional-summary p {
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 20px;
}
.stat-boxes {
  display: flex;
  gap: 16px;
}
.stat-box {
  flex: 1;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
}
.light-theme .stat-box {
  background-color: #e9ecef;
}
.stat-box .number {
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.stat-box .label {
  color: var(--muted);
  font-size: 14px;
  margin-top: 4px;
}
.contact-details {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ==============================================
    Education & Certificates Section
    ==============================================
    */
.education-grid {
  max-width: 1000px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 28px;
}
.education-card {
  background: var(--surface);
  border-radius: 20px;
  padding: 24px;
  border: 1px solid var(--border);
}
.light-theme .education-card {
  background: var(--card);
  background-color: #f8f9fa;
}
.education-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.education-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 22px;
  color: #fff;
}
.mca-card .education-icon {
  background: linear-gradient(135deg, #a993ff, #7c5cff);
}
.bsc-card .education-icon {
  background: linear-gradient(135deg, #69db7c, #40c057);
}
.education-card h3 {
  font-size: 18px;
  margin: 0;
}
.education-card h3 span {
  display: block;
  font-size: 14px;
  color: var(--brand);
  font-weight: 500;
}
.education-details {
  background: var(--bg);
  border-radius: 12px;
  padding: 12px;
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.light-theme .education-details {
  background: #fff;
}
.education-details span {
  color: var(--muted);
  font-size: 14px;
}
.education-details strong {
  font-weight: 600;
  color: var(--text);
}

.certificates-grid {
  max-width: 1100px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
}
.certificate-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 24px;
  text-align: center;
  border: 1px solid var(--border);
  transition: transform 0.3s, box-shadow 0.3s;
  text-decoration: none;
  color: var(--text);
}
.light-theme .certificate-card {
  background: #fff;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}
.certificate-card:hover {
  transform: translateY(-5px);
}
.certificate-icon {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  margin: 0 auto 16px;
  display: grid;
  place-items: center;
  font-size: 28px;
  color: #fff;
}
.certificate-card h3 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 12px;
}
.cert-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}
/* Certificate Colors */
.java-cert .certificate-icon,
.java-cert .cert-badge {
  background: #f76707;
}
.sql-cert .certificate-icon,
.sql-cert .cert-badge {
  background: #1c7ed6;
}

/* ==============================================
    Skills Section
    ==============================================
    */
.skills-grid {
  max-width: 1100px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 24px;
}
.skill-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  transition: transform 0.3s, box-shadow 0.3s;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}
.light-theme .skill-card {
  background: #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}
.skill-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}
.skill-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}
.skill-icon {
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 24px;
  color: #fff;
}
.skill-card h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
}
.skill-details {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.skill-details span:first-child {
  color: var(--muted);
  font-size: 14px;
}
.skill-percentage {
  font-weight: 600;
}
.bar {
  height: 10px;
  background: var(--glass);
  border-radius: 999px;
  overflow: hidden;
}
.bar > span {
  display: block;
  height: 100%;
  width: 0%; /* Initial width for animation */
  border-radius: 999px;
  transition: width 1.8s cubic-bezier(0.165, 0.84, 0.44, 1);
}
.skill-card.is-visible .bar > span {
  width: var(--skill-level, 0%);
}

/* Skill Color Themes */
.html-theme .skill-icon,
.html-theme .bar > span {
  background: linear-gradient(135deg, #ff6b6b, #f06595);
}
.css-theme .skill-icon,
.css-theme .bar > span {
  background: linear-gradient(135deg, #748ffc, #4263eb);
}
.java-theme .skill-icon,
.java-theme .bar > span {
  background: linear-gradient(135deg, #f76707, #d9480f);
}
.js-theme .skill-icon,
.js-theme .bar > span {
  background: linear-gradient(135deg, #fcc419, #fab005);
}
.python-theme .skill-icon,
.python-theme .bar > span {
  background: linear-gradient(135deg, #40c057, #2f9e44);
}
.wp-theme .skill-icon,
.wp-theme .bar > span {
  background: linear-gradient(135deg, #339af0, #1c7ed6);
}

/* ==============================================
    Projects Section
    ==============================================
    */
.projects-grid {
  max-width: 1200px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 24px;
}
.project-card {
  background: var(--surface);
  border-radius: 16px;
  padding: 24px;
  border: 1px solid var(--border);
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
  display: flex;
  flex-direction: column;
}
.light-theme .project-card {
  background: #fff;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}
.project-card:hover {
  transform: translateY(-5px);
  border-color: var(--brand);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}
.project-header {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 12px;
}
.project-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 20px;
  color: #fff;
  flex-shrink: 0;
}
.project-card .title-group h3 {
  font-size: 18px;
  margin: 0;
  font-weight: 600;
}
.project-card .description {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  margin-top: 4px;
  flex-grow: 1;
  margin-bottom: 16px;
}
.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}
.tech-tag {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--glass);
  color: var(--muted);
  font-weight: 500;
}
.project-footer {
  margin-top: auto;
  display: flex;
  gap: 12px;
}
.project-btn {
  flex: 1;
  text-align: center;
  padding: 8px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 600;
  transition: 0.25s;
}
.demo-btn {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
}
.code-btn {
  background: var(--glass);
  color: var(--text);
  border: 1px solid var(--border);
}
.project-btn:hover {
  transform: translateY(-2px);
}

/* Project Icon Colors */
.p-icon-1 {
  background: linear-gradient(135deg, #7c5cff, #a25cff);
}
.p-icon-2 {
  background: linear-gradient(135deg, #31e1c0, #31c8e1);
}
.p-icon-3 {
  background: linear-gradient(135deg, #f76707, #fab005);
}
.p-icon-4 {
  background: linear-gradient(135deg, #e64980, #c2255c);
}
.p-icon-5 {
  background: linear-gradient(135deg, #4dabf7, #1c7ed6);
}
.p-icon-6 {
  background: linear-gradient(135deg, #51cf66, #37b24d);
}
.p-icon-7 {
  background: linear-gradient(135deg, #5c7cfa, #31e1c0);
}
.p-icon-8 {
  background: linear-gradient(135deg, #fd7e14, #ff922b);
}
.p-icon-9 {
  background: linear-gradient(135deg, #228be6, #4c6ef5);
}

/* ==============================================
    Project Modal
    ==============================================
    */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  z-index: 2000;
  display: none; /* Hidden by default */
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.modal-overlay.active {
  display: flex;
  opacity: 1;
}
.modal-window {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  width: 90%;
  height: 85%;
  max-width: 1200px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow);
  transform: scale(0.95);
  transition: transform 0.3s ease, width 0.3s ease, height 0.3s ease;
}
.modal-overlay.active .modal-window {
  transform: scale(1);
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.modal-title {
  font-weight: 600;
}
.modal-controls {
  display: flex;
  gap: 8px;
}
.modal-controls button {
  background: var(--glass);
  border: 1px solid var(--border);
  color: var(--muted);
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: 0.2s;
}
.modal-controls button:hover {
  background: var(--brand);
  color: #fff;
}
.modal-body {
  flex-grow: 1;
  overflow: hidden;
}
.modal-body iframe {
  width: 100%;
  height: 100%;
  border: none;
}
/* Modal States */
.modal-window.maximized {
  width: 100%;
  height: 100%;
  border-radius: 0;
}
.modal-window.minimized {
  width: 350px;
  height: 50px;
  position: fixed;
  bottom: 20px;
  right: 20px;
  overflow: hidden;
}
.modal-window.minimized .modal-body {
  display: none;
}

/* ==============================================
    Contact Section
    ==============================================
    */
.contact-grid {
  max-width: 1100px;
  margin-inline: auto;
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 28px;
}
.contact-info-wrap {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.light-theme .contact-card {
  background: #fff;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}
.contact-icon {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-size: 20px;
  color: #fff;
}
.contact-card.email .contact-icon {
  background: linear-gradient(135deg, #a993ff, #7c5cff);
}
.contact-card.phone .contact-icon {
  background: linear-gradient(135deg, #69db7c, #40c057);
}
.contact-card.location .contact-icon {
  background: linear-gradient(135deg, #ff922b, #f76707);
}
.contact-card .label {
  color: var(--muted);
  font-size: 13px;
}
.contact-card .value {
  font-weight: 500;
}
.contact-socials {
  display: flex;
  gap: 12px;
  margin-top: 8px;
}
.contact-socials a {
  width: 44px;
  height: 44px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--muted);
  text-decoration: none;
  transition: 0.25s;
}
.contact-socials a:hover {
  background: var(--brand);
  color: #fff;
}
.contact-form-wrap {
  background: var(--surface);
  border-radius: 16px;
  padding: 24px;
  border: 1px solid var(--border);
}
.light-theme .contact-form-wrap {
  background: #fff;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}
.contact-form-wrap h3 {
  font-size: 20px;
  margin-bottom: 16px;
}

/* ==============================================
    Footer
    ==============================================
    */
footer {
  border-top: 1px solid var(--border);
  padding: 24px 20px;
  text-align: center;
  color: var(--muted);
  transition: border-top 0.3s;
}

/* ==============================================
    Responsive Media Queries
    ==============================================
    */
@media (max-width: 980px) {
  .hero-grid {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 60px;
  }
  .hero-grid > div:first-child {
    order: 2;
  }
  .hero-grid > div:last-child {
    order: 1;
    margin: 0 auto;
  }
  .subtitle {
    margin-left: auto;
    margin-right: auto;
  }
  .cta {
    justify-content: center;
  }
  .about-grid,
  .timeline-grid,
  .education-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }
  .projects-grid {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 780px) {
  nav ul {
    display: none;
  }
  .hamburger {
    display: grid;
  }
  .skills-grid {
    grid-template-columns: 1fr;
  }
  .card-hero {
    flex-direction: column;
    text-align: center;
  }
}
