/* styles.css — Global styles for Xmas Baubles */

/* ===== RESET & BASE ===== */
* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  background: #0b1220;
  color: #ffffff;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}

/* ===== TREE PAGE (index.html) ===== */
#tree-wrap {
  min-height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  position: relative;
  /* Optional: Add a festive background */
  background: linear-gradient(180deg, #0b1220 0%, #1a2332 100%);
}

#tree {
  position: relative;
  max-width: 1080px;
  margin: 0 auto;
  padding: 60px 20px;
  min-height: 80vh;
}

/* Tree rows */
.row {
  position: relative;
  height: 140px;
  margin-bottom: 8px;
}

/* Bauble styling with animation */
.bauble {
  position: absolute;
  transform: translate(-50%, 0);
  width: 96px;
  height: 96px;
  object-fit: contain;
  border-radius: 50%;
  cursor: pointer;
  transition: transform 0.3s ease, filter 0.3s ease;
  filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.4));
  animation: fadeInBauble 0.6s ease-out backwards;
}

.bauble:hover {
  transform: translate(-50%, -8px) scale(1.1);
  filter: drop-shadow(0 8px 20px rgba(255, 215, 0, 0.5));
}

@keyframes fadeInBauble {
  from {
    opacity: 0;
    transform: translate(-50%, -20px) scale(0.8);
  }
  to {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

/* ===== DECORATION PAGE (decoration.html) ===== */
#threeMount canvas {
  border-radius: 12px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.controls input[type="range"] {
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.15);
  outline: none;
  transition: background 0.2s;
}

.controls input[type="range"]:hover {
  background: rgba(255, 255, 255, 0.25);
}

.controls input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #2d7cff;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s, background 0.2s;
}

.controls input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.2);
  background: #5094ff;
}

.controls input[type="range"]::-moz-range-thumb {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #2d7cff;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  border: none;
  transition: transform 0.2s, background 0.2s;
}

.controls input[type="range"]::-moz-range-thumb:hover {
  transform: scale(1.2);
  background: #5094ff;
}

.controls input[type="text"],
.controls select {
  width: 100%;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 8px;
  color: #fff;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s, background 0.2s;
}

.controls input[type="text"]:focus,
.controls select:focus {
  border-color: #2d7cff;
  background: rgba(255, 255, 255, 0.15);
}

.controls input[type="text"]::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

/* Buttons */
.btn {
  appearance: none;
  border: 0;
  padding: 10px 16px;
  border-radius: 8px;
  background: #2d7cff;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  transition: background 0.2s, transform 0.1s;
  box-shadow: 0 2px 8px rgba(45, 124, 255, 0.3);
}

.btn:hover:not(:disabled) {
  background: #5094ff;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(45, 124, 255, 0.4);
}

.btn:active:not(:disabled) {
  transform: translateY(0);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}

.btn.secondary {
  background: #424a5d;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.btn.secondary:hover:not(:disabled) {
  background: #525b70;
}

/* Panels */
.panel {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 20px;
  backdrop-filter: blur(10px);
}

/* ===== MODERATION PAGE (moderation.html) ===== */
.card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  gap: 16px;
  align-items: center;
  transition: background 0.2s, border-color 0.2s;
}

.card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.2);
}

.card img {
  width: 96px;
  height: 96px;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ===== UTILITIES ===== */
.comic {
  font-family: "Comic Sans MS", "Comic Sans", cursive;
}

code {
  font-family: "SF Mono", Monaco, Consolas, "Courier New", monospace;
  background: rgba(255, 255, 255, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.9em;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .row {
    height: 100px;
  }

  .bauble {
    width: 64px;
    height: 64px;
  }

  #tree {
    padding: 40px 12px;
  }

  .panel {
    padding: 16px;
  }

  .card {
    flex-direction: column;
    align-items: flex-start;
  }

  .card img {
    width: 100%;
    height: auto;
    max-width: 200px;
    align-self: center;
  }
}

/* ===== OBS-FRIENDLY ===== */
/* For OBS browser sources at 1920×1080 */
@media (min-width: 1920px) {
  body {
    font-size: 18px;
  }

  #tree {
    max-width: 1400px;
  }

  .row {
    height: 160px;
  }

  .bauble {
    width: 120px;
    height: 120px;
  }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .bauble:hover {
    transform: translate(-50%, 0);
  }
}

/* Focus styles for keyboard navigation */
.btn:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid #2d7cff;
  outline-offset: 2px;
}

/* ===== LOADING STATE ===== */
.loading {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
