/* =========================================================
   THEME VARIABLES
========================================================= */
:root {
  --bg-body: #0a0a0a;
  --text-primary: #ffffff;
  --text-secondary: #aaa;
  --surface-0: #111111;
  --surface-0-border: #333333;
  --surface-1: #0f0f0f;
  --accent: #8ad4d1;
  --accent-contrast: #000000;
  --hover-bg: #ffffff;
  --hover-text: #000000;
  --overlay-bg: rgba(10, 10, 10, 0.8);
  --modal-bg: #111111;
  --shadow-soft: rgba(255, 255, 255, 0.05);
  --shadow-strong: rgba(0, 0, 0, 0.3);
  --loader-track: #333333;
  --loader-spin: var(--accent);
  --transition-speed: 0.3s;
}

[data-theme="light"] {
  --bg-body: #E0E4EB;
  --text-primary: #1a1a1a;
  --text-secondary: #666;
  --surface-0: #ffffff;
  --surface-0-border: #dddddd;
  --surface-1: #f1f1f1;
  --badge-bg: #f1f1f1;
  --badge-text: #777;
  --accent: #0077b6;
  --accent-contrast: #ffffff;
  --hover-bg: #111111;
  --hover-text: #ffffff;
  --overlay-bg: rgba(255, 255, 255, 0.85);
  --modal-bg: #ffffff;
  --shadow-soft: rgba(0, 0, 0, 0.08);
  --shadow-strong: rgba(0, 0, 0, 0.15);
  --loader-track: #dddddd;
  --loader-spin: var(--accent);
}

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

body {
  font-family: 'Poppins', sans-serif;
  background-color: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.6;
  scroll-behavior: smooth;
}

a {
  color: inherit;
  text-decoration: none;
}

.container {
  width: 90%;
  max-width: 1000px;
  margin: auto;
  padding: 0 5px;
}

/* =========================================================
   Dynamic Background
========================================================= */
.background {
  position: fixed;
  top: 0;
  left: 0;
  z-index: -1;
  width: 100vw;
  height: 100vh;
  overflow: hidden;
}

.waves {
  position: absolute;
  bottom: 0;
  width: 100%;
  height: 100%;
  opacity: 0.3;
}

/* =========================================================
   HERO SECTION
========================================================= */
#hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  padding: 4rem 0;
}

.hero-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 2rem;
}

.profile-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

#hero h1 {
  font-size: clamp(1.8rem, 6vw, 3rem);
  font-weight: 600;
  color: var(--text-primary);
}

#hero p {
  font-size: clamp(0.9rem, 2.5vw, 1.2rem);
  color: var(--text-secondary);
}

.btn2 {
  padding: 0.5rem 1rem;
  border: 1.5px solid var(--accent);
  background: linear-gradient(135deg, rgba(138, 212, 209, 0.1), transparent);
  color: var(--text-primary);
  border-radius: 6px;
  transition: all var(--transition-speed) ease;
  width: fit-content;
  position: relative;
  overflow: hidden;
}

.btn2::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(138, 212, 209, 0.2), transparent);
  transition: left 0.5s ease;
}

.btn2:hover::before {
  left: 100%;
}

.btn2:hover {
  background: linear-gradient(135deg, var(--accent), rgba(138, 212, 209, 0.8));
  color: var(--accent-contrast);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(138, 212, 209, 0.3);
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.socials-icons a {
  font-size: 1.3rem;
  color: var(--accent);
  margin-right: 0.75rem;
  transition: color var(--transition-speed) ease;
}

.socials-icons a:hover {
  color: var(--hover-bg);
}

.profile-img {
  width: 300px;
  height: 300px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  box-shadow: 0 0 15px var(--shadow-soft);
  transition: transform 0.8s ease, opacity 0.5s ease;
  cursor: pointer;
  backface-visibility: hidden;
}

/* Typed Cursor */
#typed-text::after {
  content: '|';
  margin-left: 4px;
  animation: blink 0.7s infinite;
}

#typed-text.no-cursor::after {
  content: '';
  animation: none;
  opacity: 0;
}

@keyframes blink {

  0%,
  50%,
  100% {
    opacity: 1;
  }

  25%,
  75% {
    opacity: 0;
  }
}

/* =========================================================
   Responsive Hero
========================================================= */
@media (max-width: 768px) {
  #hero {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 16px;
    padding: 2rem 1.5rem;
    margin: 1rem auto;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
  }

  .hero-flex {
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 1.5rem;
  }

  .profile-img {
    order: -1;
    margin-bottom: 1rem;
  }

  .profile-container {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    align-items: center;
    text-align: center;
  }

  #hero p {
    max-width: 100%;
  }

  .hero-actions,
  .socials-icons {
    justify-content: center;
  }

  .container {
    width: 100%;
    /* Change from 90% to 100% on mobile */
    padding: 0 1rem;
    /* Use fixed padding instead */
  }
}

/* =========================================================
   Section Headings
========================================================= */
section h2 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

/* =========================================================
   About & Skills
========================================================= */
#about p {
  color: var(--text-secondary);
}

.skills-icons {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 1rem;
}

.skills-icons img {
  width: 50px;
  height: 50px;
  background: var(--surface-1);
  padding: 0.5rem;
  border-radius: 8px;
}

/* =========================================================
   PROJECTS SECTION
========================================================= */
.projects-section {
  padding: 3rem 0;
  text-align: center;
}

.projects-section h2 {
  font-size: 1.8rem;
  font-weight: 600;
  margin-bottom: 2rem;
  color: var(--text-primary);
  text-align: left;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 3rem;
  max-width: 1000px;
  margin-left: auto;
  margin-right: auto;
}

.project-card {
  background: linear-gradient(135deg, var(--card-bg-start), var(--card-bg-end));
  border-radius: 20px;
  padding: 2.5rem 1.5rem;
  text-align: center;
  transition: all var(--transition-speed) ease;
  position: relative;
  overflow: hidden;
}

.project-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.1), transparent);
  opacity: 0;
  transition: opacity var(--transition-speed) ease;
}

.project-card:hover::before {
  opacity: 1;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

/* Card Color Themes */
.web-dev {
  --card-bg-start: #1e3a8a;
  --card-bg-end: #3b82f6;
}

.electrical {
  --card-bg-start: #7c3aed;
  --card-bg-end: #a855f7;
}

.biomedical {
  --card-bg-start: #0891b2;
  --card-bg-end: #06b6d4;
}

.project-icon {
  font-size: 4rem;
  margin-bottom: 1.5rem;
  color: rgba(255, 255, 255, 0.9);
}

.project-card h3 {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.8rem;
  color: white;
  line-height: 1.2;
}

.project-card p {
  font-size: 0.9rem;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.85);
  margin-bottom: 0;
}

.view-all {
  margin-top: 2rem;
}

.view-all .btn {
  display: inline-block;
  padding: 0.7rem 1.5rem;
  background: linear-gradient(135deg, rgba(138, 212, 209, 0.1), rgba(138, 212, 209, 0.05));
  color: var(--text-primary);
  text-decoration: none;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 500;
  transition: all var(--transition-speed) ease;
  border: 1.5px solid var(--accent);
  backdrop-filter: blur(10px);
  position: relative;
  overflow: hidden;
}

.view-all .btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(138, 212, 209, 0.2), transparent);
  transition: left 0.5s ease;
}

.view-all .btn:hover::before {
  left: 100%;
}

.view-all .btn:hover {
  background: linear-gradient(135deg, var(--accent), rgba(138, 212, 209, 0.8));
  color: var(--accent-contrast);
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(138, 212, 209, 0.3);
  border-color: var(--accent);
}

/* Icon styles using Unicode symbols */
.icon-globe::before {
  content: "🌐";
  font-size: 1em;
}

.icon-bolt::before {
  content: "⚡";
  font-size: 1em;
}

.icon-dna::before {
  content: "🧬";
  font-size: 1em;
}

/* Projects Section Responsive */
@media (max-width: 768px) {
  .projects-section {
    padding: 2rem 0;
  }

  .projects-section h2 {
    font-size: 1.8rem;
    margin-bottom: 1.5rem;
    text-align: left;
  }

  .projects-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 0 1rem;
  }

  .project-card {
    padding: 2rem 1.5rem;
    margin: 0 auto;
    max-width: 400px;
    width: 100%;
  }

  .project-icon {
    font-size: 3.5rem;
    margin-bottom: 1.2rem;
  }

  .project-card h3 {
    font-size: 1.1rem;
    margin-bottom: 0.6rem;
  }

  .project-card p {
    font-size: 0.85rem;
    line-height: 1.3;
  }

  .view-all .btn {
    padding: 0.6rem 1.3rem;
    font-size: 0.9rem;
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .projects-grid {
    gap: 1.5rem;
  }

  .project-card {
    padding: 2rem 1.2rem;
  }

  .project-card h3 {
    font-size: 1.3rem;
  }

  .project-card p {
    font-size: 0.9rem;
  }
}

/* =========================================================
   Experience & Education
========================================================= */
.experience-education-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: space-between;
}

.half-column {
  flex: 1;
  min-width: 280px;
}

.timeline .event {
  margin-bottom: 1.5rem;
}

.timeline h3 {
  font-size: 1rem;
}

.timeline p {
  color: var(--text-secondary);
  font-size: 0.9rem;
}

/* =========================================================
   Contact
========================================================= */
.contact-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: space-between;
  align-items: flex-start;
}

.contact-form,
.contact-info {
  flex: 1;
  min-width: 280px;
}

.contact-info h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.contact-info p {
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.contact-info .socials a {
  margin-right: 1rem;
  font-size: 1.4rem;
  color: var(--accent);
  transition: color var(--transition-speed) ease;
}

.contact-info .socials a:hover {
  color: var(--hover-bg);
}

#contactForm {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

#contactForm input,
#contactForm textarea {
  padding: 0.75rem 1rem;
  background: var(--surface-0);
  border: 1px solid var(--surface-0-border);
  color: var(--text-primary);
  border-radius: 6px;
}

#contactForm input:focus,
#contactForm textarea:focus {
  border-color: var(--accent);
  outline: none;
}

#contactForm .btn {
  padding: 0.6rem 1.2rem;
  background: linear-gradient(135deg, rgba(138, 212, 209, 0.1), transparent);
  border: 1.5px solid var(--accent);
  color: var(--text-primary);
  width: fit-content;
  border-radius: 6px;
  transition: all var(--transition-speed) ease;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

#contactForm .btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(138, 212, 209, 0.2), transparent);
  transition: left 0.5s ease;
}

#contactForm .btn:hover::before {
  left: 100%;
}

#contactForm .btn:hover {
  background: linear-gradient(135deg, var(--accent), rgba(138, 212, 209, 0.8));
  color: var(--accent-contrast);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(138, 212, 209, 0.3);
}

/* =========================================================
   Footer
========================================================= */
footer {
  text-align: center;
  padding: 10px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}

footer .socials-icons {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  margin-bottom: 1.5rem;
}

footer .socials-icons a {
  color: var(--text-secondary);
  font-size: 1.5rem;
  transition: color var(--transition-speed) ease;
}

footer .socials-icons a:hover {
  color: var(--accent);
}

footer .scroll-top {
  display: inline-block;
  margin-top: 0.7rem;
  color: var(--accent);
  text-decoration: none;
  font-size: 0.85rem;
}

footer .scroll-top:hover {
  color: var(--hover-bg);
}

/* =========================================================
   Modal
========================================================= */
.modal {
  position: fixed;
  z-index: 999;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--overlay-bg);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-content {
  background: var(--modal-bg);
  padding: 24px;
  border-radius: 10px;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 0 20px var(--shadow-soft);
  color: var(--text-primary);
  border: 1px solid var(--surface-0-border);
  font-family: 'Poppins', sans-serif;
}

.modal-content h3 {
  font-size: 1.3rem;
  color: var(--accent);
  margin-bottom: 16px;
  text-align: center;
}

.modal-content input {
  background: var(--bg-body);
  border: 1px solid var(--surface-0-border);
  color: var(--text-primary);
  padding: 12px;
  border-radius: 6px;
  margin: 10px 0;
  width: 100%;
  font-size: 14px;
}

.modal-content input:focus {
  border-color: var(--accent);
  outline: none;
}

.modal-content button {
  background: linear-gradient(135deg, rgba(138, 212, 209, 0.1), transparent);
  border: 1.5px solid var(--accent);
  color: var(--accent);
  padding: 12px;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 12px;
  width: 100%;
  font-size: 15px;
  transition: all var(--transition-speed) ease;
  position: relative;
  overflow: hidden;
}

.modal-content button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(138, 212, 209, 0.2), transparent);
  transition: left 0.5s ease;
}

.modal-content button:hover::before {
  left: 100%;
}

.modal-content button:hover {
  background: linear-gradient(135deg, var(--accent), rgba(138, 212, 209, 0.8));
  color: var(--accent-contrast);
  transform: translateY(-1px);
  box-shadow: 0 4px 15px rgba(138, 212, 209, 0.3);
}

/* =========================================================
   Loader & Spinner
========================================================= */
.loader {
  border: 4px solid var(--loader-track);
  border-top: 4px solid var(--loader-spin);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  animation: spin 1s linear infinite;
  margin: 12px auto;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

#spinner p {
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
  margin-top: 8px;
}

/* =========================================================
   Success Popup
========================================================= */
.success-popup {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface-0);
  color: var(--accent);
  padding: 12px 20px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  font-size: 1rem;
  z-index: 999;
  box-shadow: 0 4px 12px var(--shadow-strong);
  animation: fadeInOut 4s ease-in-out;
  pointer-events: none;
}

@keyframes fadeInOut {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }

  10%,
  90% {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }

  100% {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }
}

/* =========================================================
   Theme Toggle Slider (Fixed Version)
========================================================= */
.theme-toggle-slider {
  position: fixed !important;
  bottom: 20px !important;
  right: 20px !important;
  z-index: 999999 !important;
  opacity: 1;
  transition: opacity 0.5s ease-in-out;
}

.theme-toggle-slider.hidden {
  opacity: 0;
  pointer-events: none;
}

.slider-container {
  position: relative;
  display: inline-block;
  width: 70px;
  height: 36px;
}

.slider-container input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
  z-index: -1;
}

.slider-track {
  position: relative;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(10px) saturate(180%);
  border-radius: 50px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 6px;
  transition: background 0.4s ease, transform 0.3s ease;
  cursor: pointer;
}

.slider-circle {
  position: absolute;
  top: 50%;
  left: 4px;
  /* Fixed: Proper initial position */
  transform: translateY(-50%);
  width: 28px;
  height: 28px;
  background: rgba(255, 255, 255, 0.85);
  border-radius: 50%;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2), 0 0 6px rgba(255, 255, 255, 0.6) inset;
  transition: left 0.4s ease, transform 0.3s ease;
}

/* Fixed: Proper positioning when checked */
.slider-input:checked+.slider-track .slider-circle {
  left: 38px;
  /* This ensures the circle stays within bounds (70px - 28px - 4px margin = 38px) */
}

/* Light theme adjustments */
[data-theme="light"] .slider-track {
  background: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .slider-circle {
  background: rgba(0, 0, 0, 0.85);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2), 0 0 6px rgba(0, 0, 0, 0.1) inset;
}

/* Mobile responsiveness */
@media (max-width: 480px) {
  .slider-container {
    width: 60px;
    height: 32px;
  }

  .slider-circle {
    width: 24px;
    height: 24px;
    left: 4px;
  }

  .slider-input:checked+.slider-track .slider-circle {
    left: 32px;

  }
}