/* EMDR Space - Shared Styles */

/* ===========================================
   Design Tokens - Standardized Values
   =========================================== */
/* Border Radius: 5px (small), 10px (medium), 15px (standard) */
/* Background Opacity: 0.5 (standard), 0.7 (darker), 0.9 (solid) */
/* Spacing: 10px, 15px, 20px */

body {
  background-color: #000;
  color: white;
  font-family: 'Source Sans Pro', sans-serif;
  font-size: 19px;
  font-weight: bold;
  line-height: 1.7;
  margin: 0;
  padding: 0;
  text-shadow:
    -1px -1px 0 #000,
     1px -1px 0 #000,
    -1px  1px 0 #000,
     1px  1px 0 #000;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  height: 100vh;
  background-image: url('../img/nightsky_0.jpg');
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center center;
  background-attachment: fixed;
}

a {
  color: #3CF;
  text-decoration: underline;
  transition: all 0.3s ease;
}

a:hover {
  color: #6DF;
}

/* Typography */
h1 {
  font-size: 2rem;
  margin: 0 0 15px 0;
  padding: 0;
}

h2 {
  font-size: 1.8rem;
  margin: 0 0 15px 0;
  padding: 0;
}

h3 {
  font-size: 1.6rem;
  font-weight: 800;
  margin: 20px 0 10px 0;
  padding: 0;
  color: #fff;
}

.text-box h2:first-child {
  margin-top: 0;
}

.text-box p:first-child {
  margin-top: 0;
}

.text-box p:last-child {
  margin-bottom: 0;
}

/* Get It Buttons */
.getit-buttons {
  float: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 20px;
  margin: 0 0 15px 15px;
}

.getit-buttons img {
  width: 300px;
  height: auto;
  display: block;
}

.getit-buttons button {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
}

iframe[src*="youtube.com"] {
  width: 350px !important;
  height: 200px !important;
}

/* Navigation */
nav {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: rgba(0, 0, 0, 0.5);
  padding: 7px 20px;
  flex-shrink: 0;
  min-height: 58px;
  box-sizing: border-box;
}

nav .brand {
  font-size: 2em;
  color: #fff;
  display: flex;
  align-items: center;
  white-space: nowrap;
}

nav .brand img {
  height: 44px;
  margin-right: 10px;
  vertical-align: middle;
}

a.brand,
button.brand {
  color: #fff;
  text-decoration: none;
  background: none;
  border: none;
  cursor: pointer;
}

a.brand:hover,
button.brand:hover {
  color: #fff;
}

/* Hamburger Menu */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 44px;
  height: 34px;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 1);
  border-radius: 5px;
  cursor: pointer;
  padding: 8px;
  z-index: 1001;
}

.hamburger:focus {
  box-shadow: none;
  outline: none;
}

.hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  background-color: rgba(255, 255, 255, 0.8);
  border-radius: 2px;
}

/* Nav Buttons Container */
.nav-buttons {
  display: flex;
}

.nav-item {
  display: inline-block;
}

.nav-item .dot {
  display: none;
}

.tab-link {
  background-color: rgba(25, 25, 25, 0.9);
  color: #fff;
  border: 1px solid #fff;
  padding: 8px 18px;
  margin: 0 10px;
  cursor: pointer;
  border-radius: 15px;
  font-size: 18px;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

.tab-link:hover {
  background-color: rgba(80, 80, 80, 0.7);
}

.nav-item.active .tab-link {
  background-color: rgba(128, 128, 128, 0.5);
}

/* Content sections */
.content {
  padding: 10px 20px 20px;
  flex: 1;
  display: none;
  overflow-y: scroll;
  overflow-x: hidden;
  scrollbar-gutter: stable;
}

.content.active {
  display: block;
}

/* Scrollbar styling for content */
.content::-webkit-scrollbar {
  width: 8px;
}

.content::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.3);
}

.content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 5px;
}

.content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Text Box containers - main content boxes */
.text-box {
  background-color: rgba(0, 0, 0, 0.5);
  padding: 15px 30px 30px 30px;
  border-radius: 15px;
  margin: 0 auto 15px;
  max-width: 1200px;
  width: 90%;
}

iframe {
  width: 100%;
  height: 100%;
  border: none;
  border-radius: 15px;
}

/* Page content (for standalone pages like terms/policy) */
.page-content {
  padding: 20px;
  flex: 1;
}

/* Footer */
footer {
  background-color: rgba(0, 0, 0, 0.5);
  color: #ddd;
  text-align: center;
  padding: 10px 20px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 58px;
  box-sizing: border-box;
}

footer p {
  margin: 2px 0;
  font-size: 14px;
}

footer a {
  color: #ddd;
  text-decoration: none;
  margin: 0 5px;
}

footer a:hover {
  text-decoration: underline;
}

/* Footer link buttons (styled as links) */
.footer-link {
  background: none;
  border: none;
  color: #ddd;
  cursor: pointer;
  font-size: inherit;
  font-family: inherit;
  font-weight: inherit;
  padding: 0;
  margin: 0 5px;
}

.footer-link:hover {
  text-decoration: underline;
}

/* Buttons */
.btn {
  background-color: rgba(25, 25, 25, 0.9);
  color: #fff;
  border: 1px solid #000;
  padding: 8px 18px;
  margin: 10px 10px;
  cursor: pointer;
  border-radius: 15px;
  font-size: 18px;
  font-weight: bold;
  transition: background-color 0.3s ease;
}

.btn:hover {
  background-color: rgba(80, 80, 80, 0.7);
}

/* Popup */
.popup-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
  justify-content: center;
  align-items: center;
  z-index: 1000;
  flex-direction: column;
  gap: 20px;
}

.popup-overlay img {
  max-width: 80vw;
  max-height: 80vh;
  border-radius: 10px;
}

.popup-overlay button {
  background: #fff;
  border: none;
  padding: 5px 10px;
  cursor: pointer;
  border-radius: 5px;
  align-self: center;
}

/* Disclaimer */
.disclaimer {
  color: #fca5a9;
  max-width: 1200px;
  width: 90%;
  margin: 15px auto;
  text-align: center;
}

/* WLED Config Styles */
.wled-list {
  text-align: left;
  padding-left: 20px;
  margin: 15px 0;
}

.wled-list li {
  margin: 8px 0;
}

.wiring-images {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 15px;
  margin: 15px 0;
}

.wiring-figure {
  margin: 0;
  background-color: rgba(0, 0, 0, 0.35);
  border-radius: 10px;
  padding: 10px;
}

.wiring-figure img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  display: block;
}

.wiring-figure figcaption {
  margin-top: 8px;
  color: #ddd;
  font-size: 0.95rem;
  line-height: 1.4;
}

.flash-controls {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin: 20px 0;
}

.device-status {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 15px;
  background-color: rgba(50, 50, 50, 0.5);
  border-radius: 10px;
  font-size: 1rem;
}

.device-status .status-icon {
  font-size: 1.2rem;
  color: #888;
}

.device-status.connected .status-icon {
  color: #4CAF50;
}

.device-status.error .status-icon {
  color: #f44336;
}

.device-status.flashing .status-icon {
  color: #ff9800;
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.flash-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.flash-buttons-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.flash-buttons-row .btn {
  flex: 1;
  margin: 0;
}

.btn-primary {
  background-color: rgba(33, 150, 243, 0.7);
}

.btn-primary:hover {
  background-color: rgba(33, 150, 243, 0.9);
}

.btn-success {
  background-color: rgba(76, 175, 80, 0.7);
}

.btn-success:hover:not(:disabled) {
  background-color: rgba(76, 175, 80, 0.9);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.firmware-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.firmware-info label {
  color: #ddd;
}

.firmware-select {
  background-color: rgba(50, 50, 50, 0.7);
  color: #ddd;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 14px;
  cursor: pointer;
}

.firmware-select:focus {
  outline: none;
  border-color: #9F6;
}

.console-container {
  background-color: rgba(0, 0, 0, 0.7);
  border-radius: 10px;
  overflow: hidden;
  margin: 15px 0;
}

.console-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 15px;
  background-color: rgba(50, 50, 50, 0.7);
  color: #ddd;
  font-size: 0.9rem;
}

.btn-small {
  background-color: transparent;
  color: #ddd;
  border: 1px solid rgba(255, 255, 255, 0.3);
  padding: 4px 10px;
  border-radius: 5px;
  font-size: 12px;
  cursor: pointer;
}

.btn-small:hover {
  background-color: rgba(255, 255, 255, 0.1);
}

.console-output {
  padding: 10px 15px;
  height: 200px;
  overflow-y: auto;
  font-family: 'Courier New', monospace;
  font-size: 13px;
  line-height: 1.5;
}

.console-line {
  margin: 2px 0;
  word-break: break-all;
}

.console-line.info {
  color: #8bc34a;
}

.console-line.error {
  color: #f44336;
}

.console-line.warn {
  color: #ff9800;
}

.console-line.data {
  color: #03a9f4;
}

.console-output::-webkit-scrollbar {
  width: 8px;
}

.console-output::-webkit-scrollbar-track {
  background: rgba(0, 0, 0, 0.5);
}

.console-output::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.2);
  border-radius: 5px;
}

.console-output::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.3);
}

/* Progress bar for flashing */
.progress-container {
  background-color: rgba(50, 50, 50, 0.5);
  border-radius: 5px;
  overflow: hidden;
  margin-top: 10px;
  display: none;
}

.progress-bar {
  height: 20px;
  background: linear-gradient(90deg, #4CAF50, #8bc34a);
  width: 0%;
  transition: width 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: white;
}

/* Utility classes */
.text-center {
  text-align: center;
}

.mt-0 {
  margin-top: 0;
}

.mt-10 {
  margin-top: 10px;
}

.mt-15 {
  margin-top: 15px;
}

.clickable {
  cursor: pointer;
}

/* Demo iframe container */
.demo-iframe-container {
  text-align: center;
  margin-top: 0;
}

.demo-iframe-container iframe {
  max-width: 1200px;
  width: 90%;
  height: 550px;
  border: 5px solid #000;
}

.demo-buttons {
  text-align: center;
  margin-top: 0;
}

/* Highlight colors for inline text */
.highlight-green {
  color: #9F6;
}

.highlight-white {
  color: white;
}

/* Responsive */
@media (max-width: 768px) {
  body {
    font-size: 17px;
  }

  .content {
    padding: 10px 10px 20px;
  }

  .text-box {
    width: 95%;
  }

  .getit-buttons {
    gap: 8px;
    margin: 0 0 10px 10px;
  }

  .getit-buttons img {
    width: 200px;
  }

  .hamburger {
    display: flex;
  }

  nav {
    position: relative;
  }

  .nav-buttons {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background-color: transparent;
    border-radius: 0;
    padding: 5px 0;
    flex-direction: column;
    min-width: 150px;
    z-index: 1000;
  }

  .nav-buttons.show {
    display: flex;
  }

  .nav-item {
    margin: 5px 0;
    width: 100%;
  }

  .tab-link {
    width: 100%;
    text-align: center;
    margin: 0;
    padding: 10px 20px;
    border-radius: 15px;
    background-color: rgba(25, 25, 25, 0.9);
    border: 1px solid #fff;
  }

  .nav-item.active .tab-link {
    background-color: rgba(128, 128, 128, 0.9);
    border-radius: 15px;
  }

  nav .brand {
    font-size: 1.5em;
  }

  nav .brand img {
    height: 30px;
  }

  footer {
    font-size: 14px;
  }

  iframe[src*="youtube.com"] {
    width: 100% !important;
    height: auto !important;
  }

  .demo-iframe-container iframe {
    height: 350px;
  }

  .flash-buttons-row {
    flex-direction: column;
    align-items: stretch;
  }

  .flash-buttons-row .btn,
  .flash-buttons-row .firmware-select,
  .flash-buttons-row .btn-small {
    width: 100%;
    text-align: center;
  }
}
