/**
 * theme-toggle.css
 * Styling for theme toggle button and theme-specific elements
 */

/* ----- THEME TOGGLE BUTTON ----- */
#themeToggle,
.theme-toggle-btn {
  position: absolute;
  z-index: 1000;
  background: transparent;
  border-width: 1px;
  border-style: solid;
  font-family: var(--terminal-font, "VT323", monospace);
  transition: all 0.3s ease;
  cursor: pointer;
  white-space: nowrap;
  text-transform: uppercase;
  outline: none;
  display: flex;
  align-items: center;
  justify-content: center;
  top: 30px;
  left: 15px;
}

/* Active and focus states for accessibility */
#themeToggle:active,
.theme-toggle-btn:active {
  transform: translateY(1px);
  box-shadow: 0 0 2px rgba(0, 0, 0, 0.3);
}

#themeToggle:focus,
.theme-toggle-btn:focus {
  box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.3);
  outline: none;
}

/* ----- THEME VARIABLES ----- */
/* Bitcoin theme (orange) */
html.bitcoin-theme {
  --primary-color: #f2a900;
  --primary-color-rgb: 242, 169, 0;
}

body:not(.deepsea-theme):not(.matrix-theme) #themeToggle,
body:not(.deepsea-theme):not(.matrix-theme) .theme-toggle-btn {
  color: #f2a900;
  border-color: #f2a900;
}

body:not(.deepsea-theme):not(.matrix-theme) #themeToggle:hover,
body:not(.deepsea-theme):not(.matrix-theme) .theme-toggle-btn:hover {
  background-color: rgba(242, 169, 0, 0.1);
  box-shadow: 0 4px 8px rgba(242, 169, 0, 0.3);
}

body:not(.deepsea-theme):not(.matrix-theme) #themeToggle:focus,
body:not(.deepsea-theme):not(.matrix-theme) .theme-toggle-btn:focus {
  box-shadow: 0 0 0 3px rgba(242, 169, 0, 0.3);
}

/* DeepSea theme (blue) */
html.deepsea-theme {
  --primary-color: #0088cc;
  --primary-color-rgb: 0, 136, 204;
}

body.deepsea-theme #themeToggle,
body.deepsea-theme .theme-toggle-btn {
  color: #0088cc;
  border-color: #0088cc;
}

body.deepsea-theme #themeToggle:hover,
body.deepsea-theme .theme-toggle-btn:hover {
  background-color: rgba(0, 136, 204, 0.1);
  box-shadow: 0 4px 8px rgba(0, 136, 204, 0.3);
}

body.deepsea-theme #themeToggle:focus,
body.deepsea-theme .theme-toggle-btn:focus {
  box-shadow: 0 0 0 3px rgba(0, 136, 204, 0.3);
}

/* Matrix theme (green) */
html.matrix-theme {
  --primary-color: #39ff14;
  --primary-color-rgb: 57, 255, 20;
}

body.matrix-theme #themeToggle,
body.matrix-theme .theme-toggle-btn {
  color: #39ff14;
  border-color: #39ff14;
  background-color: #000;
}

body.matrix-theme #themeToggle:hover,
body.matrix-theme .theme-toggle-btn:hover {
  background-color: rgba(57, 255, 20, 0.1);
  box-shadow: 0 0 10px rgba(57, 255, 20, 0.6) !important;
}

body.matrix-theme #themeToggle:focus,
body.matrix-theme .theme-toggle-btn:focus {
  box-shadow: 0 0 0 3px rgba(57, 255, 20, 0.3);
}

/* ----- RESPONSIVE STYLING ----- */
/* Desktop view */
@media screen and (min-width: 768px) {
  #themeToggle,
  .theme-toggle-btn {
    padding: 6px 0px 6px 6px;
    font-size: 14px;
    letter-spacing: 0.5px;
  }

  #themeToggle:before,
  .theme-toggle-btn:before {
    content: " ₿|🌊";
    margin-right: 5px;
    font-size: 14px;
  }

  #themeToggle:hover,
  .theme-toggle-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  }
}

/* Mobile view */
@media screen and (max-width: 767px) {
  #themeToggle,
  .theme-toggle-btn {
    padding: 10px;
    font-size: 12px;
    width: 40px;
    height: 35px;
  }

  #themeToggle:before,
  .theme-toggle-btn:before {
    content: " ₿|🌊";
    margin-right: 0;
    font-size: 14px;
  }

  #themeToggle span,
  .theme-toggle-btn span {
    display: none;
  }
}

/* Small mobile and landscape view */
@media screen and (max-width: 767px) and (max-height: 500px) {
  #themeToggle,
  .theme-toggle-btn {
    top: 5px;
    left: 5px;
    width: 35px;
    height: 35px;
    font-size: 10px;
  }
}

/* ----- THEME LOADING STYLES ----- */
#theme-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  font-family: var(--terminal-font, "VT323", monospace);
}

html.bitcoin-theme #theme-loader {
  background-color: #111111;
  color: #f2a900;
}

html.deepsea-theme #theme-loader {
  background-color: #0c141a;
  color: #0088cc;
}

#loader-icon {
  font-size: 48px;
  margin-bottom: 20px;
  animation: spin 2s infinite linear;
}

#loader-text {
  font-size: 24px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

#loader-quote {
  font-size: 20px;
  max-width: 80%;
  text-align: center;
  margin-top: 10px;
}

/* ----- ANIMATIONS ----- */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

@keyframes pulse {
  0%,
  100% {
    opacity: 0.8;
  }

  50% {
    opacity: 1;
  }
}

/* Theme-specific graph container */
#graphContainer {
  box-shadow: 0 0 10px rgba(var(--primary-color-rgb), 0.2) !important;
}
