:root {
  --bg-color: #121212;
  --bg-alt: #1f1f1f;
  --text-color: #eeeeee;
  --text-alt: #ccc;
  --primary-color: #00ffff;
  --primary-color-hover: #00cfff;
  --shadow-color: rgba(0, 255, 255, 0.3);
  --btn-bg: transparent;
  --btn-color: var(--primary-color);
  --btn-hover-bg: var(--primary-color);
  --btn-hover-color: #121212;
}

body.light-theme {
  --bg-color: #f5f7fa;
  --bg-alt: #ffffff;
  --text-color: #222;
  --text-alt: #555;
  --primary-color: #0077b6;
  --primary-color-hover: #005f86;
  --shadow-color: rgba(0, 119, 182, 0.3);
  --btn-bg: transparent;
  --btn-color: var(--primary-color);
  --btn-hover-bg: var(--primary-color);
  --btn-hover-color: #f5f7fa;
}

/* Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 3px;
}

body {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background: var(--bg-color);
  color: var(--text-color);
  line-height: 1.6;
  scroll-behavior: smooth;
  transition: background-color 0.5s ease, color 0.5s ease;
}

a {
  color: var(--primary-color);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--primary-color-hover);
}

/* ==================== HEADER ==================== */
/* --- HEADER BELOW: UNTOUCHED FROM YOUR CODE --- */

/* Header container */
header {
  background: var(--bg-alt);
  padding: 1.5rem 2rem;
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 2px 6px var(--shadow-color);

  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: nowrap;
  transition: background-color 0.5s ease, box-shadow 0.5s ease;
}

/* Header content (nav + theme toggle) */
#header-content {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Navigation */
nav {
  display: flex;
  gap: 1rem;
  justify-content: center;
  align-items: center;
  transition: max-height 0.3s ease, opacity 0.3s ease;
}

nav a {
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--text-color);
  transition: color 0.3s ease;
}

nav a:hover {
  color: var(--primary-color-hover);
}

/* Theme toggle button */
#theme-toggle {
  background: var(--btn-bg);
  border: 2px solid var(--primary-color);
  color: var(--btn-color);
  padding: 0.4rem 1rem;
  font-size: 1rem;
  border-radius: 20px;
  cursor: pointer;
  font-weight: 600;
  transition: all 0.3s ease;
  user-select: none;
  margin-left: auto;
}

#theme-toggle:hover {
  background: var(--btn-hover-bg);
  color: var(--btn-hover-color);
  box-shadow: 0 0 15px var(--primary-color);
}

/* Hamburger button (hidden on desktop) */
#menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  z-index: 1100;
  position: relative;
  width: 30px;
  height: 30px;
  margin-left: auto;
}

/* Hamburger lines */
.hamburger,
.hamburger::before,
.hamburger::after {
  content: "";
  display: block;
  width: 25px;
  height: 3px;
  background-color: var(--primary-color);
  border-radius: 3px;
  position: absolute;
  left: 0;
  transition: all 0.3s ease;
}

.hamburger {
  top: 50%;
  transform: translateY(-50%);
  position: relative;
}

.hamburger::before {
  top: -8px;
}

.hamburger::after {
  top: 8px;
}

#menu-toggle.active .hamburger {
  background-color: transparent;
}

#menu-toggle.active .hamburger::before {
  transform: rotate(45deg);
  top: 0;
}

#menu-toggle.active .hamburger::after {
  transform: rotate(-45deg);
  top: 0;
}

/* MOBILE STYLES */
@media (max-width: 768px) {
  #menu-toggle {
    display: block;
  }

  #header-content {
    display: none;
    flex-direction: column;
    background-color: var(--bg-alt);
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    padding: 1rem 2rem;
    box-shadow: 0 8px 20px var(--shadow-color);
    border-radius: 0 0 15px 15px;
    z-index: 999;
  }

  #header-content.show {
    display: flex;
  }

  nav {
    flex-direction: column;
    gap: 1rem;
  }

  nav a {
    padding: 0.75rem 0;
    font-size: 1.1rem;
    border-bottom: 1px solid var(--primary-color);
  }

  nav a:last-child {
    border-bottom: none;
  }

  #theme-toggle {
    margin-left: 0;
    padding: 0.5rem 1.2rem;
    width: 100%;
    text-align: center;
    border-radius: 10px;
  }

  header {
    padding: 1rem 1.5rem;
    justify-content: flex-start;
  }
}

/* ==================== REST OF THE PAGE ==================== */

section {
  max-width: 900px;
  margin: 3rem auto;
  padding: 0 1rem;
}

/* HERO */
.hero {
  text-align: center;
  padding: 4rem 1rem 6rem;
  background: linear-gradient(135deg, var(--primary-color)cc, var(--primary-color-hover)cc);
  border-radius: 15px;
  box-shadow: 0 8px 20px var(--shadow-color);
  color: var(--text-color);
}

.hero h2 {
  font-size: 3rem;
  font-weight: 300;
  margin-bottom: 0.5rem;
  text-shadow: 1px 1px 5px rgba(0, 0, 0, 0.083);
}

.hero p {
  font-size: 1.3rem;
  font-weight: 400;
  margin-bottom: 2rem;
}

.btn {
  background: var(--btn-bg);
  border: 2px solid var(--primary-color);
  color: var(--btn-color);
  padding: 0.75rem 2rem;
  font-size: 1.1rem;
  border-radius: 40px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-block;
  text-decoration: none;
  font-weight: 600;
  user-select: none;
  box-shadow: 0 0 15px var(--primary-color);
}

.btn:hover {
  background: var(--btn-hover-bg);
  color: var(--btn-hover-color);
  box-shadow: 0 0 30px var(--primary-color);
}

/* About */
#about {
  background: var(--bg-alt);
  border-radius: 15px;
  padding: 2rem;
  box-shadow: 0 6px 15px var(--shadow-color);
}

#about h3 {
  font-size: 2rem;
  margin-bottom: 1rem;
  color: var(--primary-color);
}

#about p {
  font-size: 1.15rem;
  line-height: 1.8;
  color: var(--text-alt);
}

/*Experience*/

#experience {
  padding: 20px 0;
}

#experience h3 {
  font-size: 22px;
  color: var(--primary-color);
  margin-bottom: 12px;
  margin-top: 8px;
  text-align: center;
}


#experience h3#experience-title {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  text-align: center;
}

#experience p {
  text-align: left;
  line-height: 1.8;
  margin-bottom: 1.2rem;
  font-size: 1.05rem;
  color: var(--text-alt);
}

#experience ul {
  padding-left: 1.5rem;
  margin-bottom: 1.5rem;
  list-style: none;
}

#experience li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: 0.8rem;
  line-height: 1.6;
  font-size: 1.05rem;
  color: var(--text-color);
}

#experience li::before {
  content: '▹';
  /* Custom bullet */
  position: absolute;
  left: 0;
  color: var(--primary-color);
  font-weight: bold;
}


.timeline {
  position: relative;
  max-width: 1000px;

}

.timeline::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 2px;
  background-color: var(--primary-color);
  transform: translateX(-50%);
}

.timeline-item {
  position: relative;
  width: 56%;
  padding-top: 24px;
}

.timeline-item.left {
  left: 0;
  padding-right: 100px;
}

.timeline-item.right {
  left: 50%;
  padding-left: 50px;
  text-align: left;
}

.timeline-item .content {
  background: var(--bg-alt);
  padding: 1.2rem 1.5rem;
  border-radius: 10px;
  box-shadow: 0 4px 12px var(--shadow-color);
}

.timeline-item .date {
  font-weight: bold;
  color: var(--primary-color);
  margin-bottom: 0.5rem;
  display: block;
}

/* Responsive: stack on mobile */
@media (max-width: 768px) {
  .timeline::before {
    left: 12px;
  }

  .timeline-item,
  .timeline-item.left,
  .timeline-item.right {
    width: 100%;
    left: 0;
    text-align: left;
    padding-left: 2.5rem;
    padding-right: 1rem;
  }
}


/* Skills */
#skills {
  margin-top: 4rem;
}

#skills h3 {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  text-align: center;
}

.skills-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 1.2rem;
}

.skill-item {
  background: var(--bg-alt);
  border-radius: 10px;
  padding: 1rem 2rem;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--primary-color);
  box-shadow: 0 0 10px var(--primary-color);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: default;
  user-select: none;
}

.skill-item:hover {
  transform: scale(1.1);
  box-shadow: 0 0 20px var(--primary-color);
}

/* Portfolio */
#portfolio {
  margin-top: 4rem;
}

#portfolio h3 {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  text-align: center;
}

.portfolio-note {
  max-width: 900px;
  margin: 1.5rem auto 3rem auto;
  font-size: 1rem;
  color: var(--text-color, #333);
  text-align: center;
}

.portfolio-note a {
  color: var(--primary-color, #007acc);
  text-decoration: underline;
}

.portfolio-note a:hover {
  color: var(--primary-hover-color, #005f99);
}

.projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
}

.project-card {
  background: var(--bg-alt);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 4px 20px var(--shadow-color);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}

.project-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 30px var(--shadow-color);
}

.project-img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  transition: filter 0.5s ease;
}

body.light-theme .project-img {
  filter: brightness(0.9);
}

.project-info {
  padding: 1rem 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.project-info h4 {
  color: var(--primary-color);
  margin-bottom: 0.5rem;
}

.project-info p {
  color: var(--text-alt);
  flex-grow: 1;
  font-size: 1rem;
}

.project-links {
  margin-top: 1rem;
  display: flex;
  gap: 1rem;
}

.project-links a {
  border: 2px solid var(--primary-color);
  padding: 0.4rem 1rem;
  border-radius: 15px;
  font-weight: 600;
  color: var(--primary-color);
  transition: background-color 0.3s ease, color 0.3s ease;
  user-select: none;
}

.project-links a:hover {
  background: var(--primary-color);
  color: var(--btn-hover-color);
  box-shadow: 0 0 15px var(--primary-color);
}

/*Medium*/
/* Medium Articles Carousel Container */
#medium-articles {
  max-width: 900px;
  margin: 2rem auto;
}

#medium-articles h3#medium-articles-title {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 1.5rem;
  text-align: center;
}


/* Carousel Wrapper */
.carousel {
  position: relative;
  overflow: hidden;
}

/* Track Container */
.carousel-track-container {
  overflow: hidden;
}

/* Carousel Track */
.carousel-track {
  display: flex;
  transition: transform 0.4s ease-in-out;
  padding: 0;
  margin: 0;
  list-style: none;
}

/* Each Slide */
.carousel-slide {
  min-width: 300px;
  margin-right: 1rem;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  border-radius: 8px;
  overflow: hidden;
  background: var(--bg-alt, #fff);
  cursor: pointer;
}

.carousel-slide img {
  width: 100%;
  height: 180px;
  object-fit: cover;
}

.carousel-slide h4 {
  padding: 0.5rem 1rem 1rem;
  font-size: 1.1rem;
  color: var(--text-color, #222);
}

/* Buttons styling */
.carousel button.prev,
.carousel button.next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.4);
  /* Slightly stronger background */
  border: none;
  color: white;
  font-size: 2rem;
  width: 40px;
  /* Fixed width and height for perfect circle */
  height: 40px;
  padding: 0;
  cursor: pointer;
  border-radius: 50%;
  /* Perfectly round */
  user-select: none;
  display: flex;
  /* Center icon vertically and horizontally */
  justify-content: center;
  align-items: center;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: background 0.3s ease;
  z-index: 10;
  /* Ensure buttons are always on top */
}

.carousel button.prev:hover,
.carousel button.next:hover {
  background: rgba(0, 0, 0, 0.7);
}

/* Position left and right buttons */
.carousel button.prev {
  left: 0.5rem;
}

.carousel button.next {
  right: 0.5rem;
}


/* Contact */
#contact {
  background: var(--bg-alt);
  border-radius: 15px;
  padding: 2rem;
  box-shadow: 0 6px 15px var(--shadow-color);
  text-align: center;
}

#contact h3 {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
}

#contact p {
  color: var(--text-alt);
  margin-bottom: 1.5rem;
  font-size: 1.15rem;
}

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

.social-icons a {
  font-size: 2rem;
  color: var(--text-color, #333);
  transition: color 0.3s;
}

.social-icons a:hover {
  color: var(--primary-color, #00a0d6);
}


/* Footer */
footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-alt);
  font-size: 0.9rem;
}