/* Required CSS styles for the navbar and dark mode toggle */

/* Import the handwriting font */
@import url("https://fonts.googleapis.com/css2?family=Dancing+Script:wght@600;700&display=swap");

/* Handwriting font class */
.handwriting-font {
  font-family: "Dancing Script", cursive;
  font-weight: 700;
}

/* Light Mode Styles - applied to HTML tag */
html.light {
  --bg-gradient-from: #fafafa;
  --bg-gradient-to: #f3f4f6;
  --text-gradient-from: #1f2937;
  --text-gradient-to: #4b5563;
  --highlight-color: #ffd43b;
}

/* Dark Mode Styles - applied to HTML tag */
html.dark {
  --bg-gradient-from: #111827;
  --bg-gradient-to: #1f2937;
  --text-gradient-from: #f9fafb;
  --text-gradient-to: #e5e7eb;
  --highlight-color: #fbbf24;
}

/* Background gradient */
.bg-gradient {
  background: linear-gradient(
    135deg,
    var(--bg-gradient-from) 0%,
    var(--bg-gradient-to) 100%
  );
  transition: background 0.3s ease;
}

/* Text gradient */
.text-gradient {
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  background-image: linear-gradient(
    to right,
    var(--text-gradient-from),
    var(--text-gradient-to)
  );
}

/* Highlight style for the name */
.yellow-highlight {
  position: relative;
  display: inline-block;
}

.yellow-highlight::after {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 0;
  width: 100%;
  height: 8px;
  background-color: var(--highlight-color);
  z-index: -1;
  transform: translateY(2px);
}

/* Toggle switch styling */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 60px;
  height: 30px;
  cursor: pointer;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #ccc;
  transition: 0.4s;
  border-radius: 34px;
}

.toggle-slider:before {
  position: absolute;
  content: "";
  height: 22px;
  width: 22px;
  left: 4px;
  bottom: 4px;
  background-color: white;
  transition: 0.4s;
  border-radius: 50%;
}

input:checked + .toggle-slider {
  background-color: var(--highlight-color);
}

input:checked + .toggle-slider:before {
  transform: translateX(30px);
}

.toggle-moon,
.toggle-sun {
  position: absolute;
  top: 6px;
  font-size: 16px;
  z-index: 1;
}

.toggle-moon {
  right: 8px;
}

.toggle-sun {
  left: 8px;
}

/* Animation for the floating effect */
@keyframes float-slow {
  0%,
  100% {
    transform: translateY(0) rotate(0);
  }
  25% {
    transform: translateY(-5px) rotate(-1deg);
  }
  75% {
    transform: translateY(5px) rotate(1deg);
  }
}

.animate-float-slow {
  animation: float-slow 6s ease-in-out infinite;
}

/* Animation for shimmer effect */
@keyframes shimmer {
  0% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.5;
  }
}

.animate-shimmer {
  animation: shimmer 3s ease-in-out infinite;
}

/* Performance optimizations for smooth scrolling */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  overflow-x: hidden;
  overflow-y: scroll;
}

/* Hardware acceleration for better performance */
.bg-gradient,
[data-aos],
.animate-float-slow,
.animate-shimmer,
nav {
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Optimize animations */
@keyframes float-slow {
  0%,
  100% {
    transform: translateY(0) translateZ(0) rotate(0);
  }
  25% {
    transform: translateY(-5px) translateZ(0) rotate(-1deg);
  }
  75% {
    transform: translateY(5px) translateZ(0) rotate(1deg);
  }
}

@keyframes shimmer {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
}

/* Smooth transition for all sections */
section {
  transform: translateZ(0);
  will-change: auto;
}

/* Reduce motion for accessibility */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Responsive styles */
@media (max-width: 768px) {
  .md\:flex {
    display: none;
  }
  .md\:hidden {
    display: block;
  }
}
