/* =========================================================
   THEME VARIABLES
========================================================= */
:root {
  --bg-body: #0a0a0a;
  --text-primary: #ffffff;
  --text-secondary: #aaa;
  --surface-0: #111111;
  --surface-0-border: #333333;
  --surface-1: #0f0f0f;
  --surface-1-border: #222222;
  --badge-bg: #333333;
  --badge-text: #aaa;
  --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);
}

[data-theme="light"] {
  --bg-body: #fdfdfd;
  --text-primary: #1a1a1a;
  --text-secondary: #666;
  --surface-0: #ffffff;
  --surface-0-border: #dddddd;
  --surface-1: #f1f1f1;
  --surface-1-border: #d0d0d0;
  --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;
}

/* =========================================================
   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;
}

/* =========================================================
   Body
========================================================= */
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: 5px;
}

/* =========================================================
   Hero
========================================================= */
/* Simple blinking cursor */
#typed-text::after {
  content: '|';
  animation: blink 1s step-start infinite;
  opacity: 1;
}

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

@keyframes blink {
  50% {
    opacity: 0;
  }
}

.hero {
  padding: 10px 2rem 2rem 1px;
}

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

.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: 1px solid var(--surface-0-border);
  background: transparent;
  color: var(--text-primary);
  border-radius: 6px;
  transition: all 0.3s ease;
  width: fit-content;
}

.btn2:hover {
  background: var(--hover-bg);
  color: var(--hover-text);
}

.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-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.social-icons {
  margin-top: 1rem;
  display: flex;
  justify-content: center;
  gap: 1px;
}

.socials-icons a {
  font-size: 1.3rem;
  color: var(--accent);
  margin-right: 0.75rem;
  transition: color 0.3s 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;
}

.profile-pic:hover {
  transform: rotateY(180deg);
}

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


@keyframes blink {

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

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

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 768px) {
  .hero-flex {
    flex-direction: row;
    /* Keep row layout */
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
  }

  .profile-container {
    flex: 1;
    max-width: 60%;
  }

  .profile-img {
    width: 180px;
    height: 180px;
    margin-top: 1rem;
  }
}

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

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

.about {
  padding-top: 2rem;
  margin-bottom: 0;
}

/* =========================================================
   Skills
========================================================= */
.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
========================================================= */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.project-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

.project-badge {
  background-color: var(--badge-bg);
  color: var(--badge-text);
  font-size: 0.7rem;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.project-card {
  position: relative;
  background: var(--surface-0);
  border: 1px solid var(--surface-0-border);
  border-radius: 12px;
  overflow: hidden;
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.project-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 20px var(--shadow-strong);
}

.project-card img {
  width: 100%;
  border-radius: 6px;
  object-fit: cover;
  height: 220px;
  margin-bottom: 1rem;
}

.project-info {
  padding: 1rem;
}

.project-info h3 {
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.project-info p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.project-info p#project-link-text {
  font-size: 0.85rem;
  color: var(--accent);
  margin-top: 0.5rem;
}

/* =========================================================
   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 {
  margin-bottom: 1rem;
}

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

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

.contact-info .btn2 {
  margin-top: 1rem;
}

#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: transparent;
  border: 1px solid var(--surface-0-border);
  color: var(--text-primary);
  width: fit-content;
  border-radius: 4px;
}

#contactForm .btn:hover {
  background: var(--hover-bg);
  color: var(--hover-text);
}

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

footer .container {
  max-width: 800px;
  margin: 0 auto;
}

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 0.3s ease;
}

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

footer p {
  margin: 0.5rem 0;
}

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

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

.scroll-top {
  display: block;
  margin-top: 1rem;
  color: var(--accent);
}

footer #typed-text::after {
  content: none;
}

/* =========================================================
   Responsive (second block)
========================================================= */
@media (max-width: 768px) {
  #hero {
    flex-direction: column;
    text-align: center;
    gap: 2rem;
  }

  .profile-container {
    align-items: center;
  }

  .experience-education-wrapper {
    flex-direction: column;
  }
}

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

/* Modal Content Box */
.modal-content {
  background: var(--modal-bg);
  /* deep dark/light background */
  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 Heading */
.modal-content h3 {
  font-size: 1.3rem;
  color: var(--accent);
  margin-bottom: 16px;
  text-align: center;
}

/* Input Fields */
.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;
}

/* Submit Button */
.modal-content button {
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 12px;
  border-radius: 6px;
  cursor: pointer;
  margin-top: 12px;
  width: 100%;
  font-size: 15px;
  transition: all 0.3s ease;
}

.modal-content button:hover {
  background: var(--accent);
  color: var(--accent-contrast);
}

/* =========================================================
   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 message */
#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;
}

@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-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 45px;
  height: 45px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-contrast);
  border: none;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
  z-index: 9999;
  transition: background 0.3s, transform 0.2s ease;
}

.theme-toggle-btn:hover {
  transform: scale(1.1);
  background: var(--hover-bg);
}

@media (max-width: 480px) {
  .theme-toggle-btn {
    bottom: auto;
    top: 15px;
    right: 15px;
    /* Optional: reduce size on mobile */
    width: 40px;
    height: 40px;
  }
}