/* CSS Variables for Theme System */
:root {
  /* Dark Theme Variables (Default) */
  --bg-primary: #0d1117;
  --bg-secondary: #161b22;
  --bg-tertiary: rgba(255, 255, 255, 0.05);
  --bg-gradient: linear-gradient(135deg, #161b22 0%, #0d1117 100%);

  --text-primary: #f8f8f2;
  --text-secondary: #8b949e;
  --text-accent: #ff006e;

  --accent-primary: #ff006e;
  --accent-secondary: #8338ec;
  --accent-tertiary: #3a86ff;

  --border-color: rgba(255, 255, 255, 0.1);
  --shadow-color: rgba(131, 56, 236, 0.3);
  --overlay-color: rgba(13, 17, 23, 0.8);

  --navbar-bg: rgba(13, 17, 23, 0.95);
  --navbar-bg-scrolled: rgba(13, 17, 23, 0.98);
  --navbar-blur: blur(10px);

  /* Dark theme button colors */
  --btn-primary-bg: linear-gradient(45deg, #ff006e, #8338ec);
  --btn-primary-hover-bg: linear-gradient(45deg, #8338ec, #3a86ff);
  --btn-secondary-border: #8338ec;
  --btn-secondary-hover-bg: linear-gradient(90deg, #8338ec, #ff006e);
}

/* Light Theme Variables */
[data-theme="light"] {
  --bg-primary: #f0f8ff;
  --bg-secondary: #e6f3ff;
  --bg-tertiary: rgba(135, 206, 250, 0.1);
  --bg-gradient: linear-gradient(135deg, #e6f3ff 0%, #f0f8ff 100%);

  --text-primary: #2c3e50;
  --text-secondary: #5a6c7d;
  --text-accent: #2980b9;

  --accent-primary: #5dade2;
  --accent-secondary: #3498db;
  --accent-tertiary: #85c1e9;

  --border-color: rgba(93, 173, 226, 0.3);
  --shadow-color: rgba(93, 173, 226, 0.4);
  --overlay-color: rgba(240, 248, 255, 0.9);

  --navbar-bg: rgba(240, 248, 255, 0.95);
  --navbar-bg-scrolled: rgba(240, 248, 255, 0.98);
  --navbar-blur: blur(20px);

  /* Light theme specific button colors */
  --btn-primary-bg: linear-gradient(45deg, #5dade2, #3498db);
  --btn-primary-hover-bg: linear-gradient(45deg, #85c1e9, #5dade2);
  --btn-secondary-border: #3498db;
  --btn-secondary-hover-bg: linear-gradient(90deg, #5dade2, #85c1e9);
}

/* Reset và base styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Poppins", sans-serif;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* Global transition for theme switching */
* {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

/* Preserve specific transitions for interactive elements */
.nav-link,
.theme-toggle,
.btn-primary,
.btn-secondary,
.tech-item,
.project-card,
.contact-item,
.about-item {
  transition: all 0.3s ease;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Navigation Bar */
.navbar {
  position: fixed;
  top: 0;
  width: 100%;
  background: var(--navbar-bg);
  backdrop-filter: var(--navbar-blur);
  z-index: 1000;
  transition: all 0.3s ease, transform 0.3s ease;
  border-bottom: 1px solid var(--border-color);
}

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 20px;
}

.nav-logo span {
  font-family: "Righteous", cursive;
  font-size: 1.5rem;
  background: linear-gradient(45deg, var(--accent-primary), var(--accent-secondary), var(--accent-tertiary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.nav-menu {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-link {
  color: var(--text-primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
  position: relative;
}

.nav-link:hover {
  color: var(--accent-primary);
}

.nav-link::after {
  content: "";
  position: absolute;
  width: 0;
  height: 2px;
  bottom: -5px;
  left: 0;
  background: linear-gradient(45deg, var(--accent-primary), var(--accent-secondary));
  transition: width 0.3s ease;
}

.nav-link:hover::after {
  width: 100%;
}

.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background: var(--text-primary);
  margin: 3px 0;
  transition: 0.3s;
}

/* Theme Toggle Button */
.theme-toggle {
  background: none;
  border: 2px solid var(--accent-primary);
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--accent-primary);
  font-size: 1rem;
  margin-left: 1rem;
  position: relative;
  overflow: hidden;
}

.theme-toggle::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--accent-primary);
  transition: left 0.3s ease;
  z-index: -1;
}

.theme-toggle:hover::before {
  left: 0;
}

.theme-toggle:hover {
  color: var(--bg-primary);
  transform: scale(1.1) rotate(15deg);
  box-shadow: 0 5px 15px var(--shadow-color);
}

.theme-toggle i {
  transition: transform 0.3s ease;
  position: relative;
  z-index: 1;
}

/* Hero Section - Always Dark Theme */
.hero-section {
  height: 100vh;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  /* Force dark theme colors for hero section */
  --hero-text-primary: #f8f8f2;
  --hero-text-secondary: #8b949e;
  --hero-accent-primary: #ff006e;
  --hero-accent-secondary: #8338ec;
  --hero-accent-tertiary: #3a86ff;
  --hero-overlay: rgba(13, 17, 23, 0.7);
}

.hero-background {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -2;
}

.hero-gif {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--hero-overlay);
  z-index: -1;
}

.hero-content {
  text-align: center;
  z-index: 1;
}

.hero-title {
  font-family: "Righteous", cursive;
  font-size: 3.5rem;
  margin-bottom: 1rem;
  background: linear-gradient(
    45deg,
    var(--hero-accent-primary),
    var(--hero-accent-secondary),
    var(--hero-accent-tertiary)
  );
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  min-height: 5rem;
}

.cursor {
  animation: blink 1s infinite;
  color: var(--hero-accent-primary);
}

@keyframes blink {
  0%,
  50% {
    opacity: 1;
  }
  51%,
  100% {
    opacity: 0;
  }
}

.hero-subtitle {
  font-size: 1.3rem;
  margin-bottom: 2rem;
  color: var(--hero-text-secondary);
}

.hero-badges {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.hero-badges img {
  transition: transform 0.3s ease;
}

.hero-badges img:hover {
  transform: scale(1.1);
}

.scroll-indicator {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  animation: bounce 2s infinite;
}

.scroll-arrow {
  font-size: 2rem;
  color: var(--hero-accent-secondary);
}

@keyframes bounce {
  0%,
  20%,
  50%,
  80%,
  100% {
    transform: translateX(-50%) translateY(0);
  }
  40% {
    transform: translateX(-50%) translateY(-10px);
  }
  60% {
    transform: translateX(-50%) translateY(-5px);
  }
}

/* Section Titles */
.section-title {
  font-family: "Righteous", cursive;
  font-size: 2.5rem;
  text-align: center;
  margin-bottom: 3rem;
  background: linear-gradient(45deg, var(--accent-primary), var(--accent-secondary), var(--accent-tertiary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* About Section */
.about-section {
  padding: 100px 0;
  background: var(--bg-gradient);
}

.about-content {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 3rem;
  align-items: center;
}

.about-item {
  display: flex;
  align-items: center;
  margin-bottom: 1.5rem;
  padding: 1rem;
  background: var(--bg-tertiary);
  border-radius: 10px;
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
}

.about-item:hover {
  background: var(--bg-tertiary);
  transform: translateX(10px);
  box-shadow: 0 5px 15px var(--shadow-color);
}

.about-item i {
  font-size: 1.2rem;
  margin-right: 1rem;
  color: var(--accent-secondary);
  min-width: 24px;
}

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

.about-item a:hover {
  color: var(--accent-secondary);
}

.about-image {
  text-align: center;
}

.programming-gif {
  width: 100%;
  max-width: 350px;
  border-radius: 20px;
  box-shadow: 0 20px 40px var(--shadow-color);
}

/* Education Section */
.education-section {
  padding: 100px 0;
  background: var(--bg-gradient);
}

.timeline {
  position: relative;
  max-width: 800px;
  margin: 0 auto;
}

.timeline::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 4px;
  background: linear-gradient(180deg, var(--accent-primary), var(--accent-secondary), var(--accent-tertiary));
  transform: translateX(-50%);
}

.timeline-item {
  position: relative;
  margin: 2rem 0;
  display: flex;
  align-items: center;
}

.timeline-item:nth-child(odd) {
  flex-direction: row;
}

.timeline-item:nth-child(even) {
  flex-direction: row-reverse;
}

.timeline-marker {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 60px;
  background: linear-gradient(45deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: white;
  border: 4px solid var(--bg-primary);
  z-index: 2;
}

.timeline-content {
  background: var(--bg-tertiary);
  padding: 2rem;
  border-radius: 15px;
  width: calc(50% - 40px);
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
}

.timeline-item:nth-child(odd) .timeline-content {
  margin-right: auto;
  margin-left: 40px;
}

.timeline-item:nth-child(even) .timeline-content {
  margin-left: auto;
  margin-right: 40px;
}

.timeline-content:hover {
  background: var(--bg-tertiary);
  transform: translateY(-5px);
  box-shadow: 0 20px 40px var(--shadow-color);
}

.timeline-content h3 {
  color: var(--accent-primary);
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
}

.timeline-content h4 {
  color: var(--accent-secondary);
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.timeline-date {
  background: linear-gradient(45deg, var(--accent-primary), var(--accent-secondary));
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
  display: inline-block;
  margin-bottom: 1rem;
}

.timeline-content p {
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

/* Tech Stack Section */
.tech-section {
  padding: 100px 0;
  background: var(--bg-primary);
}

.tech-category {
  margin-bottom: 4rem;
}

.tech-category h3 {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  color: var(--accent-secondary);
  text-align: center;
}

.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 2rem;
  justify-items: center;
}

.tech-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.5rem;
  background: var(--bg-tertiary);
  border-radius: 15px;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  z-index: 1;
  border: 1px solid var(--border-color);
}

.tech-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  opacity: 0.2;
  transition: left 0.4s ease;
  z-index: -1;
}

.tech-item:hover::before {
  left: 0;
}

.tech-item:hover {
  transform: scale(1.1) rotateY(5deg);
  box-shadow: 0 10px 30px var(--shadow-color);
  background: var(--bg-tertiary);
}

.tech-item img {
  width: 50px;
  height: 50px;
  margin-bottom: 0.5rem;
}

.tech-item span {
  font-size: 0.9rem;
  font-weight: 500;
  text-align: center;
}

/* GitHub Stats Section */
.github-section {
  padding: 100px 0;
  background: linear-gradient(135deg, #161b22 0%, #0d1117 100%);
}

.github-stats {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  align-items: center;
}

.stats-row {
  display: flex;
  gap: 2rem;
  justify-content: center;
  flex-wrap: wrap;
}

.stats-row img {
  border-radius: 10px;
  transition: transform 0.3s ease;
  max-width: 100%;
  height: auto;
}

.stats-row img:hover {
  transform: scale(1.05);
}

/* Projects Section */
.projects-section {
  padding: 100px 0;
  background: var(--bg-gradient);
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 3rem;
  margin-top: 3rem;
}

.project-card {
  background: var(--bg-tertiary);
  border-radius: 20px;
  overflow: hidden;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  border: 1px solid var(--border-color);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.project-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 25px 50px var(--shadow-color);
}

.project-image {
  position: relative;
  height: 250px;
  overflow: hidden;
}

.project-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.project-card:hover .project-image img {
  transform: scale(1.1);
}

.project-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--overlay-color);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

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

.project-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1rem;
  background: var(--bg-tertiary);
  border-radius: 10px;
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.3s ease;
  border: 1px solid var(--border-color);
}

.project-link:hover {
  background: linear-gradient(45deg, var(--accent-primary), var(--accent-secondary));
  transform: scale(1.05);
  color: white;
}

.project-link i {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.project-link span {
  font-size: 0.9rem;
  font-weight: 500;
}

.project-content {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.project-header h3 {
  font-size: 1.5rem;
  color: var(--accent-primary);
  font-weight: 600;
  margin: 0;
}

.project-date {
  background: linear-gradient(45deg, var(--accent-primary), var(--accent-secondary));
  padding: 0.3rem 0.8rem;
  border-radius: 15px;
  font-size: 0.8rem;
  font-weight: 500;
  color: white;
}

.project-description {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.5rem;
  flex: 1;
}

.project-bottom {
  margin-top: auto;
}

.project-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
}

.tech-tag {
  background: rgba(131, 56, 236, 0.2);
  color: #8338ec;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 500;
  border: 1px solid rgba(131, 56, 236, 0.3);
}

.project-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  justify-content: center;
}

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  border-radius: 25px;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  border: 2px solid transparent;
  min-width: 150px;
  flex: 1;
  max-width: 200px;
  position: relative;
  overflow: hidden;
  z-index: 1;
}

.btn-primary {
  background: var(--btn-primary-bg);
  color: white;
}

.btn-primary::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--btn-primary-hover-bg);
  transition: left 0.4s ease;
  z-index: -1;
}

.btn-primary:hover::before {
  left: 0;
}

.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px var(--shadow-color);
}

.btn-secondary {
  background: transparent;
  color: var(--btn-secondary-border);
  border-color: var(--btn-secondary-border);
}

.btn-secondary::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: var(--btn-secondary-hover-bg);
  transition: left 0.4s ease;
  z-index: -1;
}

.btn-secondary:hover::before {
  left: 0;
}

.btn-secondary:hover {
  color: white;
  border-color: var(--btn-secondary-border);
  transform: translateY(-3px);
  box-shadow: 0 10px 25px var(--shadow-color);
}

/* Connect Section */
.connect-section {
  padding: 100px 0 0;
  background: var(--bg-primary);
  text-align: center;
}

.contact-info {
  margin-bottom: 4rem;
}

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  max-width: 1000px;
  margin: 0 auto;
}

.contact-item {
  display: flex;
  align-items: center;
  padding: 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-radius: 15px;
  transition: all 0.3s ease;
  text-align: left;
}

.contact-item {
  position: relative;
  overflow: hidden;
}

.contact-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, rgba(255, 0, 110, 0.1), rgba(131, 56, 236, 0.1));
  transition: left 0.4s ease;
  z-index: 1;
}

.contact-item:hover::before {
  left: 0;
}

.contact-item:hover {
  background: rgba(255, 255, 255, 0.1);
  transform: translateY(-5px) scale(1.02);
  box-shadow: 0 15px 40px rgba(131, 56, 236, 0.4);
}

.contact-icon,
.contact-details {
  position: relative;
  z-index: 2;
}

.contact-icon {
  width: 50px;
  height: 50px;
  background: linear-gradient(45deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: white;
  margin-right: 1rem;
  flex-shrink: 0;
  transition: background 0.3s ease;
}

.contact-details h4 {
  color: var(--accent-secondary);
  font-size: 1rem;
  margin-bottom: 0.3rem;
  font-weight: 600;
}

.contact-details a {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s ease;
}

.contact-details a:hover {
  color: var(--accent-secondary);
}

.contact-details span {
  color: var(--text-primary);
  font-weight: 500;
}

.social-links {
  display: flex;
  gap: 2rem;
  justify-content: center;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.social-link {
  position: relative;
  overflow: hidden;
  border-radius: 10px;
}

.social-link::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  opacity: 0.3;
  transition: left 0.3s ease;
  z-index: 1;
}

.social-link:hover::before {
  left: 0;
}

.social-link img {
  transition: transform 0.3s ease;
  position: relative;
  z-index: 2;
}

.social-link:hover img {
  transform: scale(1.1) rotate(5deg);
}

.thank-you {
  font-size: 1.2rem;
  margin-bottom: 3rem;
  color: var(--text-secondary);
}

.footer-wave {
  margin-top: 2rem;
}

.footer-wave img {
  width: 100%;
  height: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
  }

  .nav-menu {
    position: fixed;
    left: -100%;
    top: 70px;
    flex-direction: column;
    background-color: var(--navbar-bg);
    backdrop-filter: var(--navbar-blur);
    width: 100%;
    text-align: center;
    transition: 0.3s;
    box-shadow: 0 10px 27px var(--shadow-color);
    padding: 2rem 0;
    border-top: 1px solid var(--border-color);
  }

  .nav-menu.active {
    left: 0;
  }

  .theme-toggle {
    margin: 1rem auto 0;
    display: flex;
  }

  .hero-title {
    font-size: 2.5rem;
  }

  .hero-subtitle {
    font-size: 1.1rem;
  }

  .hero-badges {
    flex-direction: column;
    align-items: center;
  }

  .about-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .about-image {
    order: -1;
  }

  /* Timeline responsive */
  .timeline::before {
    left: 30px;
  }

  .timeline-item {
    flex-direction: row !important;
  }

  .timeline-marker {
    left: 30px;
    width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .timeline-content {
    width: calc(100% - 80px);
    margin-left: 80px !important;
    margin-right: 0 !important;
  }

  .tech-grid {
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 1rem;
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* Projects responsive */
  .projects-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .project-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }

  .project-actions {
    justify-content: center;
  }

  .btn-primary,
  .btn-secondary {
    flex: 1;
    justify-content: center;
    min-width: 140px;
  }

  .stats-row {
    flex-direction: column;
    align-items: center;
  }

  .social-links {
    flex-direction: column;
    align-items: center;
  }

  .section-title {
    font-size: 2rem;
  }
}

@media (max-width: 480px) {
  .hero-title {
    font-size: 2rem;
  }

  .hero-subtitle {
    font-size: 1rem;
  }

  .container {
    padding: 0 15px;
  }

  .tech-grid {
    grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
  }

  .tech-item {
    padding: 1rem;
  }

  .tech-item img {
    width: 40px;
    height: 40px;
  }
}

/* Enhanced Animation Classes */
.animate-on-scroll {
  opacity: 0;
  transition: all 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  will-change: opacity, transform;
}

.fade-in {
  opacity: 0;
  transform: translateY(30px);
}

.fade-in.animate {
  opacity: 1;
  transform: translateY(0);
}

.slide-in-left {
  opacity: 0;
  transform: translateX(-40px);
}

.slide-in-left.animate {
  opacity: 1;
  transform: translateX(0);
}

.slide-in-right {
  opacity: 0;
  transform: translateX(40px);
}

.slide-in-right.animate {
  opacity: 1;
  transform: translateX(0);
}

.scale-in {
  opacity: 0;
  transform: scale(0.9);
}

.scale-in.animate {
  opacity: 1;
  transform: scale(1);
}

.rotate-in {
  opacity: 0;
  transform: rotate(-5deg) scale(0.95);
}

.rotate-in.animate {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.zoom-in {
  opacity: 0;
  transform: scale(0.8);
}

.zoom-in.animate {
  opacity: 1;
  transform: scale(1);
}

.flip-in {
  opacity: 0;
  transform: rotateY(-45deg);
}

.flip-in.animate {
  opacity: 1;
  transform: rotateY(0deg);
}

/* Keyframe animations for fallback */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-60px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(60px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes rotateIn {
  from {
    opacity: 0;
    transform: rotate(-10deg) scale(0.9);
  }
  to {
    opacity: 1;
    transform: rotate(0deg) scale(1);
  }
}

@keyframes zoomIn {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes flipIn {
  from {
    opacity: 0;
    transform: rotateY(-90deg);
  }
  to {
    opacity: 1;
    transform: rotateY(0deg);
  }
}

/* Scrollbar Styling */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(45deg, var(--accent-primary), var(--accent-secondary));
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(45deg, var(--accent-secondary), var(--accent-tertiary));
}

/* Loading Animation */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #8338ec;
  animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
