:root {
  --bg-dark: linear-gradient(135deg, #1e1e1e, #2c2c2c);
  --bg-light: #f5f5f5;
  --text-dark: #f0f0f0;
  --text-light: #333;
  --accent: #00ddeb;
  --card-bg-dark: rgba(255, 255, 255, 0.1);
  --card-bg-light: rgba(255, 255, 255, 0.9);
  --card-border-dark: rgba(255, 255, 255, 0.2);
  --card-border-light: rgba(0, 0, 0, 0.1);
  --shadow-dark: rgba(0, 0, 0, 0.3);
  --shadow-light: rgba(0, 0, 0, 0.1);
}

body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg-dark);
  color: var(--text-dark);
  line-height: 1.6;
  min-height: 100vh;
  animation: gradient 15s ease infinite;
  background-size: 200% 200%;
}

body.light {
  background: var(--bg-light);
  color: var(--text-light);
  animation: none;
}

@keyframes gradient {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

header {
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  text-align: center;
  padding: 3rem 1rem;
  position: sticky;
  top: 0;
  z-index: 100;
}

body.light header {
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-light);
}

.typewriter {
  font-size: 3rem;
  font-weight: 700;
  overflow: hidden;
  border-right: 0.15em solid var(--accent);
  white-space: nowrap;
  margin: 0 auto;
  letter-spacing: 0.05em;
  animation: typing 3.5s steps(40, end), blink-caret 0.75s step-end infinite;
}

@keyframes typing {
  from { width: 0; }
  to { width: 100%; }
}

@keyframes blink-caret {
  from, to { border-color: transparent; }
  50% { border-color: var(--accent); }
}

.subtitle {
  font-size: 1.2rem;
  color: #ccc;
  margin-top: 0.5rem;
}

body.light .subtitle {
  color: #666;
}

nav ul {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  list-style: none;
  margin-top: 1.5rem;
  flex-wrap: wrap;
}

nav a, #toggle-theme {
  color: var(--accent);
  text-decoration: none;
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 500;
  transition: transform 0.3s, color 0.3s;
}

nav a:hover, #toggle-theme:hover {
  color: #fff;
  transform: translateY(-2px);
}

body.light nav a:hover, body.light #toggle-theme:hover {
  color: #333;
}

section {
  max-width: 900px;
  margin: 3rem auto;
  padding: 2rem;
  background: var(--card-bg-dark);
  border: 1px solid var(--card-border-dark);
  border-radius: 15px;
  box-shadow: 0 4px 20px var(--shadow-dark);
  backdrop-filter: blur(5px);
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

body.light section {
  background: var(--card-bg-light);
  border: 1px solid var(--card-border-light);
  box-shadow: 0 4px 20px var(--shadow-light);
}

section.visible {
  opacity: 1;
  transform: translateY(0);
}

h2 {
  font-size: 2rem;
  color: var(--accent);
  margin-bottom: 1rem;
  position: relative;
}

h2::after {
  content: '';
  width: 50px;
  height: 3px;
  background: var(--accent);
  position: absolute;
  bottom: -5px;
  left: 0;
}

/* Education */
.education-item {
  background: rgba(255, 255, 255, 0.05);
  padding: 1rem;
  border-radius: 8px;
}

body.light .education-item {
  background: rgba(0, 0, 0, 0.05);
}

.education-item h3 {
  color: var(--accent);
}

.education-item span {
  color: #ccc;
  font-size: 0.9rem;
}

body.light .education-item span {
  color: #666;
}

/* Skills */
.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

.skill-category h3 {
  font-size: 1.2rem;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.skill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.skill-item {
  background: rgba(255, 255, 255, 0.1);
  padding: 0.5rem 1rem;
  border-radius: 15px;
  font-size: 0.9rem;
  transition: transform 0.3s, box-shadow 0.3s;
}

body.light .skill-item {
  background: rgba(0, 0, 0, 0.1);
}

.skill-item:hover {
  transform: scale(1.1);
  box-shadow: 0 0 10px var(--accent);
}

.skill-item:not(:last-child)::after {
  /* content: ','; */
  margin-left: 0.3rem;
  color: var(--text-dark);
}

body.light .skill-item:not(:last-child)::after {
  color: var(--text-light);
}

/* Current Work */
.work-item {
  background: rgba(255, 255, 255, 0.05);
  padding: 1.5rem;
  border-radius: 10px;
}

body.light .work-item {
  background: rgba(0, 0, 0, 0.05);
}

.work-item ul {
  list-style: disc;
  padding-left: 1.5rem;
  margin-top: 0.5rem;
}

.work-item li {
  margin-bottom: 0.5rem;
}

/* Project Cards */
.project-card {
  background: rgba(255, 255, 255, 0.05);
  padding: 1.5rem;
  margin-bottom: 1rem;
  border-radius: 10px;
  transition: transform 0.3s, box-shadow 0.3s;
}

body.light .project-card {
  background: rgba(0, 0, 0, 0.05);
}

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

.project-card h3 {
  color: var(--accent);
}

.project-tech {
  display: block;
  font-size: 0.8rem;
  color: #ccc;
  margin-top: 0.5rem;
}

body.light .project-tech {
  color: #666;
}

/* Timeline */
.timeline {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  padding-left: 2rem;
  position: relative;
}

.timeline-item {
  background: rgba(255, 255, 255, 0.05);
  padding: 1rem;
  border-radius: 8px;
  transition: transform 0.3s, box-shadow 0.3s;
}

body.light .timeline-item {
  background: rgba(0, 0, 0, 0.05);
}

.timeline-item:hover {
  transform: translateX(10px);
  box-shadow: 0 6px 20px rgba(0, 221, 235, 0.3);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: -0.4rem;
  width: 1rem;
  height: 1rem;
  background: var(--accent);
  border-radius: 50%;
  top: 1rem;
  opacity: 0;
  transition: opacity 0.3s;
}

.timeline-item:hover::before {
  opacity: 1;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0.3rem;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--accent);
}

/* Achievements */
.achievement-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.achievement-list li {
  background: rgba(255, 255, 255, 0.05);
  padding: 1rem;
  border-radius: 8px;
  position: relative;
  padding-left: 2rem;
}

body.light .achievement-list li {
  background: rgba(0, 0, 0, 0.05);
}

.achievement-list li::before {
  content: '🏆';
  position: absolute;
  left: 0.5rem;
  top: 1rem;
}

/* Contact Section */
.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.contact-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-dark);
  text-decoration: none;
  border-radius: 25px;
  transition: background 0.3s, transform 0.3s;
}

body.light .contact-btn {
  background: rgba(0, 0, 0, 0.1);
  color: var(--text-light);
}

.contact-btn:hover {
  background: var(--accent);
  color: #1e1e1e;
  transform: scale(1.05);
}

.resume-btn {
  display: flex;
  justify-content: center;
  margin-top: 1rem;
}

.btn {
  display: inline-block;
  padding: 0.8rem 1.5rem;
  background: var(--accent);
  color: #1e1e1e;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 600;
  transition: transform 0.3s;
}

.btn:hover {
  transform: scale(1.05);
}

/* Visitor Counter */
#visitor-counter {
  text-align: center;
  max-width: 900px;
  margin: 1rem auto;
  padding: 1rem;
  background: var(--card-bg-dark);
  border: 1px solid var(--card-border-dark);
  border-radius: 15px;
  box-shadow: 0 4px 20px var(--shadow-dark);
  backdrop-filter: blur(5px);
}

body.light #visitor-counter {
  background: var(--card-bg-light);
  border: 1px solid var(--card-border-light);
  box-shadow: 0 4px 20px var(--shadow-light);
}

#visitor-counter p {
  font-size: 1.1rem;
  color: var(--text-dark);
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

body.light #visitor-counter p {
  color: var(--text-light);
}

#visitor-counter #visitor-count {
  display: inline-block;
}

#visitor-counter img {
  vertical-align: middle;
  max-height: 20px; /* Adjusts counter size to fit text */
}

/* Footer */
footer {
  text-align: center;
  padding: 1.5rem;
  background: rgba(0, 0, 0, 0.7);
  color: #ccc;
  margin-top: 3rem;
}

body.light footer {
  background: rgba(0, 0, 0, 0.1);
  color: #666;
}

/* Responsive Design */
@media (max-width: 768px) {
  .typewriter {
    font-size: 2rem;
  }

  nav ul {
    gap: 1rem;
  }

  section {
    margin: 1.5rem;
    padding: 1.5rem;
  }

  .skills-grid {
    grid-template-columns: 1fr;
  }

  .skill-item {
    font-size: 0.8rem;
  }
}