/* Dark mode toggle button */
.theme-toggle-btn {
  background: none;
  border: none;
  border-radius: 9999px;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 16px;
  line-height: 1;
}

@media (min-width: 768px) {
  .theme-toggle-btn {
    margin-top: 30px;
  }
}

.theme-toggle-btn:hover {
  background: rgba(236, 72, 153, 0.05);
  transform: scale(1.1);
}

.theme-toggle-btn:focus {
  outline: none;
}

/* Icon swap: green minion in light mode, astronaut helmet in dark mode */
.theme-toggle-icon {
  width: 42px;
  height: 42px;
}

.theme-toggle-icon.icon-dark { display: none; }
body.dark-mode .theme-toggle-icon.icon-light { display: none; }
body.dark-mode .theme-toggle-icon.icon-dark { display: inline; }

/* Space Grotesk for titles and labels in dark mode */
body.dark-mode .animate-color-change-1,
body.dark-mode .animate-color-change-2,
body.dark-mode .section-title,
body.dark-mode .category-label {
  font-family: 'Space Grotesk', sans-serif;
}

/* Funky font for "Hej!" in dark mode */
body.dark-mode .hej-text {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.4em;
  letter-spacing: 0.08em;
}

/* Emoji swap: wave hand in light mode, robot SVG in dark mode */
.wave-dark { display: none; }
.wave-dark-icon {
  display: inline;
  width: 1.4em;
  height: 1.4em;
  vertical-align: -0.25em;
  margin-left: 0.2em;
}
body.dark-mode .wave-light { display: none; }
body.dark-mode .wave-dark  { display: inline; }
body.dark-mode .wave { animation-duration: 4s; }

/* ── Dark mode overrides ─────────────────────────────────── */
body.dark-mode {
  color: #f3f4f6;
}

/* Particle background */
body.dark-mode #particles-js {
  background-color: #0a0a0f;
  background-image: radial-gradient(
    circle at top right,
    rgba(255, 0, 200, 0.12),
    rgba(0, 255, 200, 0.08),
    rgba(10, 10, 15, 0) 50%
  );
}

/* Navbar */
body.dark-mode #containerNav {
  background: linear-gradient(to bottom, rgba(10, 10, 15, 0.7), transparent);
}

body.dark-mode .nav-link {
  color: #9ca3af;
}

body.dark-mode .nav-link:hover {
  color: #f3f4f6;
}

body.dark-mode .nav-link::after {
  background-image: linear-gradient(to right, #00e5ff, #39ff14);
}

body.dark-mode .theme-toggle-btn {
  color: #f3f4f6;
}

body.dark-mode .theme-toggle-btn:hover {
  background: rgba(0, 255, 200, 0.05);
}

/* Mobile menu */
body.dark-mode #mobile-menu .bg-white {
  background-color: #111118 !important;
  border-color: rgba(0, 255, 200, 0.15) !important;
}

body.dark-mode .mobile-menu-item span {
  color: #9ca3af;
}

body.dark-mode .mobile-menu-item:hover {
  background-color: rgba(0, 255, 200, 0.05) !important;
}

body.dark-mode .mobile-menu-item:hover span {
  color: #f3f4f6;
}

/* Floating card animation for dark mode */
@keyframes card-float {
  0%   { transform: translateY(0px) rotate(var(--float-rotate, 0deg)); }
  50%  { transform: translateY(-8px) rotate(var(--float-rotate, 0deg)); }
  100% { transform: translateY(0px) rotate(var(--float-rotate, 0deg)); }
}

body.dark-mode .projects-section.rotate-1,
body.dark-mode .projects-section[class*="rotate-1"] {
  --float-rotate: 1deg;
}

/* Section cards (.projects-section used for about + projects) */
body.dark-mode .projects-section {
  background: linear-gradient(to bottom, #0e0e1a, #0b0b14, #090910);
  border-color: rgba(0, 255, 200, 0.12);
  box-shadow: 0 20px 60px -10px rgba(0, 255, 200, 0.18),
              0 8px 24px -4px rgba(255, 0, 200, 0.12),
              0 0 0 1px rgba(0, 255, 200, 0.1),
              inset 0 1px 0 rgba(255, 255, 255, 0.04);
  animation: card-float 7s ease-in-out infinite;
  transition: box-shadow 0.4s ease, border-color 0.4s ease;
}

body.dark-mode .projects-section:hover {
  box-shadow: 0 28px 70px -8px rgba(0, 255, 200, 0.32),
              0 10px 32px -4px rgba(255, 0, 200, 0.2),
              0 0 50px rgba(0, 255, 200, 0.1),
              0 0 0 1px rgba(0, 255, 200, 0.22),
              inset 0 1px 0 rgba(255, 255, 255, 0.07);
  border-color: rgba(0, 255, 200, 0.22);
}

body.dark-mode .projects-section::before {
  background: linear-gradient(
    135deg,
    rgba(0, 255, 200, 0.04),
    rgba(255, 0, 200, 0.04)
  );
}

body.dark-mode .projects-section::after {
  background: linear-gradient(
    -135deg,
    rgba(255, 0, 200, 0.03),
    rgba(0, 200, 255, 0.03)
  );
}

/* Project content cards */
body.dark-mode .project-content {
  background: rgba(14, 14, 26, 0.95);
  border-color: rgba(0, 255, 200, 0.1);
}

body.dark-mode .project-card {
  background: rgba(14, 14, 26, 0.95);
}

/* About card: hide white card, layered overlays, pink backdrop, and corner decals in dark mode */
body.dark-mode .about-content {
  background: transparent !important;
  box-shadow: none !important;
  border-color: transparent !important;
}

body.dark-mode .about-content .absolute.inset-1,
body.dark-mode .about-content .absolute.inset-0,
body.dark-mode .about-content .absolute.top-2,
body.dark-mode .about-content .absolute.bottom-2 {
  display: none !important;
}

body.dark-mode .bg-gradient-to-br.from-pink-50.to-pink-100 {
  display: none !important;
}

body.dark-mode .border-pink-200 {
  border-color: rgba(0, 255, 200, 0.2) !important;
}

body.dark-mode .bg-pink-200 {
  background-color: rgba(0, 255, 200, 0.3) !important;
}

body.dark-mode .border-pink-100 {
  border-color: rgba(0, 255, 200, 0.1) !important;
}

/* Text */
body.dark-mode .text-gray-800,
body.dark-mode .text-gray-700,
body.dark-mode .text-gray-600 {
  color: #d1d5db !important;
}

body.dark-mode .text-gray-500 {
  color: #9ca3af !important;
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode h4 {
  color: #f3f4f6;
}

body.dark-mode .section-title {
  color: #e5e7eb !important;
}

body.dark-mode .section-title::after {
  background: linear-gradient(to right, #00e5ff, #39ff14);
}

/* Tech tags */
body.dark-mode .tech-tag {
  background: rgba(0, 255, 200, 0.08);
  border-color: rgba(0, 255, 200, 0.25);
  color: #6ee7b7;
}

body.dark-mode .tech-tag:hover {
  background-color: rgba(0, 255, 200, 0.15);
}

body.dark-mode .tech-stack {
  border-top-color: rgba(255, 255, 255, 0.08);
}

/* Carousel */
body.dark-mode .carousel-dot {
  background-color: rgba(255, 255, 255, 0.2);
}

body.dark-mode .carousel-dot.active {
  background-color: #00ffc8;
}

body.dark-mode .carousel-button {
  background: rgba(0, 255, 200, 0.03);
  color: #00ffc8;
  border-color: rgba(0, 255, 200, 0.2);
}

body.dark-mode .carousel-button:hover {
  background: rgba(0, 255, 200, 0.06);
  border-color: rgba(0, 255, 200, 0.35);
}

/* Project date */
body.dark-mode .project-date {
  color: #6b7280;
}

/* Footer */
body.dark-mode .funky-footer {
  background: #0a0a0f;
}

/* Toolkit section */
body.dark-mode .toolkit-section {
  background: linear-gradient(to bottom, #0e0e1a, #0b0b14, #090910);
  border-color: rgba(0, 255, 200, 0.12);
  box-shadow: 0 20px 60px -10px rgba(0, 255, 200, 0.18),
              0 8px 24px -4px rgba(255, 0, 200, 0.12),
              0 0 0 1px rgba(0, 255, 200, 0.1),
              inset 0 1px 0 rgba(255, 255, 255, 0.04);
  animation: card-float 8s ease-in-out infinite 1s;
  transition: box-shadow 0.4s ease, border-color 0.4s ease;
}

body.dark-mode .toolkit-section:hover {
  box-shadow: 0 28px 70px -8px rgba(0, 255, 200, 0.32),
              0 10px 32px -4px rgba(255, 0, 200, 0.2),
              0 0 50px rgba(0, 255, 200, 0.1),
              0 0 0 1px rgba(0, 255, 200, 0.22),
              inset 0 1px 0 rgba(255, 255, 255, 0.07);
  border-color: rgba(0, 255, 200, 0.22);
}

body.dark-mode .skill-category:not(:last-child) {
  border-bottom-color: rgba(0, 255, 200, 0.1);
}

body.dark-mode .skill-category:hover {
  background: rgba(0, 255, 200, 0.04);
}

body.dark-mode .skill-pill {
  background: #0e0e1a;
  color: #a78bfa;
  border-color: rgba(0, 255, 200, 0.2);
  box-shadow: 0 1px 4px rgba(0, 255, 200, 0.06);
}

body.dark-mode .skill-pill:hover {
  color: #c4b5fd;
  border-color: rgba(0, 255, 200, 0.4);
  box-shadow: 0 4px 12px rgba(0, 255, 200, 0.1);
}

/* GitHub Calendar section */
body.dark-mode .calendar-container {
  background: linear-gradient(to bottom, #0e0e1a, #0b0b14, #090910) !important;
  border-color: rgba(0, 255, 200, 0.12) !important;
  box-shadow: 0 20px 60px -10px rgba(0, 255, 200, 0.18),
              0 8px 24px -4px rgba(255, 0, 200, 0.12),
              0 0 0 1px rgba(0, 255, 200, 0.1),
              inset 0 1px 0 rgba(255, 255, 255, 0.04) !important;
  animation: card-float 9s ease-in-out infinite 0.5s;
  transition: box-shadow 0.4s ease, border-color 0.4s ease;
}

body.dark-mode .calendar-container:hover {
  box-shadow: 0 28px 70px -8px rgba(0, 255, 200, 0.32),
              0 10px 32px -4px rgba(255, 0, 200, 0.2),
              0 0 50px rgba(0, 255, 200, 0.1),
              0 0 0 1px rgba(0, 255, 200, 0.22),
              inset 0 1px 0 rgba(255, 255, 255, 0.07) !important;
  border-color: rgba(0, 255, 200, 0.22) !important;
}

body.dark-mode .calendar-container::before {
  background: linear-gradient(
    135deg,
    rgba(0, 255, 200, 0.04),
    rgba(255, 0, 200, 0.04)
  ) !important;
}

body.dark-mode .calendar-container::after {
  background: linear-gradient(
    -135deg,
    rgba(255, 0, 200, 0.03),
    rgba(0, 200, 255, 0.03)
  ) !important;
}

body.dark-mode .year-highlight {
  color: #d1d5db;
}

body.dark-mode .scroll-text {
  color: #9ca3af;
}

/* Scroll indicators */
body.dark-mode .scroll-indicator,
body.dark-mode .vertical-scroll-indicator {
  background: rgba(0, 229, 255, 0.03);
  border-color: rgba(0, 229, 255, 0.2);
  box-shadow: 0 4px 6px -1px rgba(0, 229, 255, 0.05),
    0 2px 4px -1px rgba(0, 229, 255, 0.03),
    inset 0 1px 2px rgba(255, 255, 255, 0.05);
}

body.dark-mode .scroll-indicator:hover,
body.dark-mode .vertical-scroll-indicator:hover {
  border-color: rgba(0, 229, 255, 0.35);
  background: rgba(0, 229, 255, 0.06);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.2),
    0 6px 8px -1px rgba(0, 229, 255, 0.08),
    inset 0 1px 2px rgba(255, 255, 255, 0.08);
}

body.dark-mode .scroll-dot,
body.dark-mode .vertical-scroll-dot {
  background: #00e5ff;
  box-shadow: 0 0 8px rgba(0, 229, 255, 0.5);
}

body.dark-mode .scroll-arrow::before,
body.dark-mode .vertical-scroll-arrow::before {
  border-right-color: rgba(0, 229, 255, 0.8);
  border-bottom-color: rgba(0, 229, 255, 0.8);
}

/* Hero heading text animations */
@keyframes dark-color-change-1 {
  0%   { color: #ff00ff; }
  50%  { color: #cc00cc; }
  100% { color: #ff00ff; }
}

@keyframes dark-color-change-2 {
  0%   { color: #39ff14; }
  50%  { color: #1aad00; }
  100% { color: #39ff14; }
}

body.dark-mode .animate-color-change-1 {
  animation-name: dark-color-change-1;
}

body.dark-mode .animate-color-change-2 {
  animation-name: dark-color-change-2;
}

body.dark-mode .text-pink-400 {
  color: #00e5ff !important;
}

/* Buttons */
body.dark-mode .button-primary {
  color: #39ff14;
  border-color: rgba(57, 255, 20, 0.35);
  background: rgba(57, 255, 20, 0.04);
  box-shadow: 0 4px 6px -1px rgba(57, 255, 20, 0.08),
    0 2px 4px -1px rgba(57, 255, 20, 0.05),
    inset 0 1px 2px rgba(255, 255, 255, 0.05);
}

body.dark-mode .button-primary:hover {
  border-color: rgba(57, 255, 20, 0.6);
  background: rgba(57, 255, 20, 0.08);
  box-shadow: 0 0 12px rgba(57, 255, 20, 0.3),
    0 6px 8px -1px rgba(57, 255, 20, 0.12),
    inset 0 1px 2px rgba(255, 255, 255, 0.08);
}

body.dark-mode .button-secondary {
  color: #00e5ff;
  border-color: rgba(0, 229, 255, 0.35);
  background: rgba(0, 229, 255, 0.04);
  box-shadow: 0 4px 6px -1px rgba(0, 229, 255, 0.08),
    0 2px 4px -1px rgba(0, 229, 255, 0.05),
    inset 0 1px 2px rgba(255, 255, 255, 0.05);
}

body.dark-mode .button-secondary:hover {
  border-color: rgba(0, 229, 255, 0.6);
  background: rgba(0, 229, 255, 0.08);
  box-shadow: 0 0 12px rgba(0, 229, 255, 0.3),
    0 6px 8px -1px rgba(0, 229, 255, 0.12),
    inset 0 1px 2px rgba(255, 255, 255, 0.08);
}
