/* Modern Theme Controls & Scroll Elements */

/* Theme Toggle Button Styles */
.theme-toggle {
  display: flex;
  align-items: center;
  margin-left: 15px;
}

.theme-switch-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

/* Apply appropriate button styles for each theme */
[data-theme="dark"] .theme-switch-btn {
  color: #ffd700; /* Golden yellow for sun in dark mode */
}

[data-theme="light"] .theme-switch-btn {
  color: #7f82c5; /* Soft purple-blue for moon in light mode */
}

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

[data-theme="dark"] .theme-switch-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

[data-theme="light"] .theme-switch-btn:hover {
  background: rgba(0, 0, 0, 0.05);
}

.theme-icon {
  position: absolute;
  width: 18px;
  height: 18px;
  transition: transform 0.5s ease, opacity 0.3s ease;
}

/* Dark Theme - Show sun icon */
[data-theme="dark"] .sun-icon {
  opacity: 1;
  transform: translateY(0) rotate(0);
  color: #ffd700; /* Sun color - golden yellow */
}

[data-theme="dark"] .moon-icon {
  opacity: 0;
  transform: translateY(-10px) rotate(-90deg);
}

/* Light Theme - Show moon icon */
[data-theme="light"] .sun-icon {
  opacity: 0;
  transform: translateY(10px) rotate(90deg);
}

[data-theme="light"] .moon-icon {
  opacity: 1;
  transform: translateY(0) rotate(0);
  color: #7f82c5; /* Moon color - soft purple-blue */
}

/* Scroll to Top Button */
.scroll-to-top {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 42px;
  height: 42px;
  background: var(--main-color);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 99;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
  border: none;
}

.scroll-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-to-top svg {
  width: 18px;
  height: 18px;
  stroke-width: 2.5;
}

/* Scroll Percentage Indicator */
.scroll-progress-container {
  position: fixed;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 100px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  z-index: 99;
  overflow: visible;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.scroll-progress-container.visible {
  opacity: 1;
  visibility: visible;
}

.scroll-progress-bar {
  width: 100%;
  background: var(--main-color);
  position: absolute;
  top: 0;
  left: 0;
  transition: height 0.1s ease;
}

.scroll-progress-text {
  position: absolute;
  right: 10px;
  font-size: 12px;
  font-weight: 500;
  color: var(--main-color);
  background: rgba(0, 0, 0, 0.5);
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}

.scroll-vertical-text {
  position: absolute;
  top: -40px;
  left: 50%;
  transform: translateX(-50%) rotate(-90deg);
  transform-origin: center;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--main-color);
  white-space: nowrap;
  pointer-events: none;
}

/* Light theme adjustments */
[data-theme="light"] .scroll-progress-container {
  background: rgba(0, 0, 0, 0.1);
}

/* Responsive Adjustments */
@media (max-width: 768px) {
  .scroll-to-top {
    width: 40px;
    height: 40px;
    bottom: 20px;
    right: 20px;
  }
}

@media (max-width: 576px) {
  .scroll-to-top {
    width: 35px;
    height: 35px;
    bottom: 15px;
    right: 15px;
  }
  
  .scroll-progress-container {
    height: 80px;
    right: 1rem;
  }
}

/* Theme aware images - fix for header image bug */
.theme-aware-image {
  display: none;
  width: 100%;
  height: auto;
  transition: none !important;
}

html[data-theme="dark"] .dark-theme-image {
  display: block;
}

html[data-theme="light"] .light-theme-image {
  display: block;
}

/* Force immediate display when theme changes, preventing the bug */
.force-visible {
  display: block !important;
  animation: none !important;
}
