/* ========================================
   WORLDVIEW CUBE - Production Stylesheet
   ======================================== */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a2e 100%);
  color: #f0f0f0;
  line-height: 1.6;
  min-height: 100vh;
  background-attachment: fixed;
}

html {
  scroll-behavior: smooth;
}

/* ============ CONTAINER ============ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 20px;
}

/* ============ HEADER ============ */
header {
  text-align: center;
  padding: 60px 20px 40px;
  background: linear-gradient(180deg, rgba(0,204,255,0.1) 0%, transparent 100%);
  border-bottom: 1px solid rgba(0,204,255,0.2);
  margin-bottom: 40px;
}

header h1 {
  font-size: 3em;
  font-weight: 300;
  letter-spacing: 2px;
  margin: 0;
  background: linear-gradient(135deg, #00ccff, #0077ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

header p {
  font-size: 1.1em;
  color: #aaa;
  max-width: 600px;
  margin: 15px auto 0;
}

/* ============ SECTIONS ============ */
section {
  background: rgba(20, 20, 30, 0.6);
  border: 1px solid rgba(0, 204, 255, 0.1);
  border-radius: 12px;
  padding: 40px;
  margin-bottom: 40px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
}

section h2 {
  font-size: 1.8em;
  font-weight: 300;
  color: #00ccff;
  margin-top: 0;
  margin-bottom: 25px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

section h3 {
  font-size: 1.3em;
  color: #88ccff;
  margin-top: 30px;
  margin-bottom: 15px;
  font-weight: 400;
}

/* ============ ABOUT SECTION ============ */
#about {
  background: rgba(15, 30, 45, 0.8);
  border: 1px solid rgba(0, 180, 220, 0.2);
}

#about p {
  margin-bottom: 18px;
  font-size: 1em;
  color: #ddd;
}

#about ul {
  list-style: none;
  padding: 0;
  margin: 20px 0;
}

#about li {
  padding: 12px 0;
  padding-left: 30px;
  position: relative;
  color: #ccc;
  font-size: 0.95em;
}

#about li::before {
  content: "→";
  position: absolute;
  left: 0;
  color: #00ccff;
  font-weight: bold;
}

#about strong {
  color: #88ccff;
  font-weight: 600;
}

.axes-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 30px 0;
}

.axis-box {
  background: rgba(0, 100, 150, 0.1);
  border-left: 3px solid #00ccff;
  padding: 15px;
  border-radius: 6px;
}

.axis-box strong {
  color: #00ffcc;
  display: block;
  margin-bottom: 8px;
}

/* ============ QUIZ SECTION ============ */
#survey {
  background: rgba(15, 30, 45, 0.8);
  border: 1px solid rgba(0, 180, 220, 0.2);
}

.question {
  margin: 24px 0;
  padding: 20px;
  background: rgba(40, 50, 70, 0.5);
  border-left: 3px solid #0077ff;
  border-radius: 8px;
  transition: all 0.3s ease;
}

.question:hover {
  background: rgba(50, 60, 80, 0.7);
  border-left-color: #00ccff;
}

.question-number {
  font-weight: bold;
  color: #00ccff;
}

.question-text {
  display: block;
  margin: 10px 0;
  font-size: 1em;
  color: #f0f0f0;
}

.options {
  display: flex;
  gap: 8px;
  margin-top: 15px;
  flex-wrap: wrap;
  justify-content: space-between;
}

.option-label {
  flex: 1;
  min-width: 100px;
  text-align: center;
  background: rgba(60, 80, 120, 0.3);
  border: 2px solid rgba(0, 200, 255, 0.2);
  padding: 12px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s ease;
  user-select: none;
  font-size: 0.85em;
  color: #aaa;
}

.option-label:hover {
  background: rgba(0, 150, 200, 0.2);
  border-color: #00ccff;
  color: #ddd;
}

input[type="radio"] {
  display: none;
}

input[type="radio"]:checked + .option-text {
  font-weight: bold;
  color: #00ff88;
}

input[type="radio"]:checked + .option-text::before {
  content: "✓ ";
  color: #00ff88;
}

.option-label:has(input:checked) {
  background: rgba(0, 100, 150, 0.4);
  border-color: #00ff88;
  color: #00ff88;
}

/* ============ PROGRESS INDICATOR ============ */
.progress-container {
  width: 100%;
  height: 3px;
  background: rgba(0, 100, 150, 0.2);
  border-radius: 3px;
  margin: 30px 0;
  overflow: hidden;
}

.progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #0077ff, #00ccff);
  width: 0%;
  transition: width 0.3s ease;
  border-radius: 3px;
}

/* ============ BUTTONS ============ */
button {
  padding: 14px 28px;
  font-size: 15px;
  font-weight: 600;
  background: linear-gradient(135deg, #0077ff 0%, #00ccff 100%);
  color: #fff;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 15px rgba(0, 119, 255, 0.3);
  margin: 10px;
}

button:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(0, 200, 255, 0.5);
  background: linear-gradient(135deg, #0099ff 0%, #00ffdd 100%);
}

button:active {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

/* Share buttons section */
.share-actions {
  text-align: center;
  margin-top: 30px;
}

.share-prompt {
  color: #888;
  margin-bottom: 15px;
  font-size: 14px;
}

.share-buttons-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.share-btn {
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 600;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: white;
  transition: all 0.3s ease;
  text-transform: none;
}

.share-btn-instagram {
  background: linear-gradient(45deg, #f09433, #e6683c, #dc2743, #cc2366, #bc1888);
}

.share-btn-instagram:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 8px 30px rgba(225, 48, 108, 0.6);
  filter: brightness(1.1);
}

.share-btn-tiktok {
  background: linear-gradient(45deg, #00f2ea, #ff0050);
}

.share-btn-tiktok:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 8px 30px rgba(0, 242, 234, 0.5);
  filter: brightness(1.1);
}

.share-btn-x {
  background: #000;
  border: 2px solid #444;
}

.share-btn-x:hover {
  transform: translateY(-4px) scale(1.05);
  box-shadow: 0 8px 30px rgba(255, 255, 255, 0.2);
  background: #1a1a1a;
  border-color: #888;
}

.button-group {
  display: flex;
  gap: 15px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 30px;
}

/* ============ RESULT SECTION ============ */
#result {
  text-align: center;
  background: rgba(15, 30, 45, 0.8);
  border: 1px solid rgba(0, 204, 255, 0.3);
  display: none;
}

#result h2 {
  margin-bottom: 30px;
}

.octant-name {
  font-size: 2.5em;
  font-weight: 300;
  color: #00ffcc;
  text-shadow: 0 0 20px rgba(0, 255, 204, 0.5);
  margin: 30px 0;
  letter-spacing: 2px;
}

.coordinates-display {
  background: rgba(0, 100, 150, 0.1);
  border: 1px solid rgba(0, 200, 255, 0.3);
  padding: 20px;
  border-radius: 8px;
  margin: 25px 0;
  font-family: 'Courier New', monospace;
  font-size: 1.1em;
}

.coordinates-display span {
  color: #00ff88;
  font-weight: bold;
}

.description-text {
  font-size: 1.1em;
  color: #ccc;
  margin: 20px 0;
  font-style: italic;
}

/* ============ 3D CANVAS ============ */
#canvas-container {
  background: rgba(10, 10, 20, 0.8);
  border: 1px solid rgba(0, 150, 200, 0.2);
  border-radius: 12px;
  overflow: hidden;
  margin: 30px 0;
  min-height: 500px;
  box-shadow: inset 0 0 30px rgba(0, 0, 0, 0.5);
}

#canvas {
  width: 100%;
  height: 100%;
}

.canvas-instructions {
  position: absolute;
  bottom: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.7);
  padding: 12px 16px;
  border-radius: 6px;
  font-size: 12px;
  color: #aaa;
  pointer-events: none;
}

/* ============ LEGEND ============ */
#legend-container {
  margin-top: 30px;
  text-align: center;
}

.toggle-legend-btn {
  background: rgba(0, 50, 80, 0.6);
  border: 2px solid rgba(0, 200, 255, 0.4);
  color: #00ccff;
  padding: 12px 24px;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.toggle-legend-btn:hover {
  background: rgba(0, 100, 150, 0.6);
  border-color: #00ffff;
  box-shadow: 0 0 20px rgba(0, 255, 255, 0.3);
  transform: translateY(-2px);
}

.toggle-legend-btn .toggle-icon {
  transition: transform 0.3s ease;
}

.toggle-legend-btn[aria-expanded="true"] .toggle-icon {
  transform: rotate(180deg);
}

#legend {
  margin: 15px auto 0;
  max-width: 100%;
  background: rgba(10, 20, 40, 0.9);
  border: 1px solid rgba(0, 200, 255, 0.3);
  padding: 20px;
  border-radius: 12px;
  font-size: 14px;
  backdrop-filter: blur(10px);
  display: none;
  box-shadow: 0 8px 32px rgba(0, 100, 150, 0.2);
  max-height: 400px;
  overflow-y: auto;
}

#legend.visible {
  display: block;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

#legend h3 {
  margin-top: 0;
  font-size: 1.1em;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #00ccff;
  border-bottom: 1px solid rgba(0, 200, 255, 0.3);
  padding-bottom: 10px;
  margin-bottom: 12px;
  text-align: center;
}

#legend-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
}

#legend-list li {
  padding: 6px 10px;
  font-size: 12px;
  color: #ccc;
  background: rgba(0, 50, 80, 0.3);
  border-radius: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  cursor: pointer;
}

#legend-list li:hover {
  background: rgba(0, 150, 200, 0.5);
  transform: scale(1.02);
  box-shadow: 0 2px 8px rgba(0, 200, 255, 0.3);
}

#legend-list span {
  font-size: 14px;
  flex-shrink: 0;
}

/* ============ AD BANNER ============ */
.ad-banner {
  margin: 50px auto;
  width: 100%;
  max-width: 728px;
  min-height: 90px;
  background: rgba(30, 30, 40, 0.6);
  border: 1px solid rgba(100, 100, 150, 0.3);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #666;
  text-align: center;
  padding: 15px;
  font-style: italic;
}

.ad-banner::before {
  content: "Advertisement Space";
}

/* Google AdSense responsive ads */
.adsbygoogle {
  display: block;
  text-align: center;
}

/* ============ DONATION BANNER ============ */
.donation-banner {
  margin: 40px auto;
  width: 100%;
  max-width: 600px;
  background: linear-gradient(135deg, rgba(0, 150, 200, 0.2), rgba(0, 100, 150, 0.15));
  border: 2px solid rgba(0, 200, 255, 0.3);
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 8px 32px rgba(0, 150, 200, 0.2);
  backdrop-filter: blur(10px);
  position: relative;
  animation: slideDown 0.5s ease-out;
}

.donation-banner.hidden {
  display: none;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.close-donation {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: #00ccff;
  font-size: 28px;
  cursor: pointer;
  transition: color 0.2s;
  padding: 0;
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-donation:hover {
  color: #00ffcc;
}

.donation-content {
  text-align: center;
}

.donation-title {
  font-size: 1.8em;
  font-weight: 300;
  color: #00ffcc;
  margin-bottom: 15px;
  letter-spacing: 1px;
}

.donation-text {
  color: #ccc;
  margin-bottom: 25px;
  font-size: 0.95em;
  line-height: 1.6;
}

.donation-links {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 20px;
}

.donation-link {
  padding: 12px 20px;
  border-radius: 6px;
  text-decoration: none;
  transition: all 0.3s ease;
  font-weight: 600;
  font-size: 0.9em;
}

.donation-link.primary {
  background: linear-gradient(135deg, #0077ff, #00ccff);
  color: white;
  box-shadow: 0 4px 15px rgba(0, 119, 255, 0.3);
}

.donation-link.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0, 200, 255, 0.4);
}

.donation-link.secondary {
  background: rgba(0, 100, 150, 0.2);
  color: #00ccff;
  border: 1px solid rgba(0, 200, 255, 0.3);
}

.donation-link.secondary:hover {
  background: rgba(0, 150, 200, 0.3);
  border-color: #00ccff;
}

.donation-hint {
  color: #888;
  font-size: 0.85em;
  margin-top: 15px;
  font-style: italic;
}

/* ============ FLOATING SUPPORT BUTTON ============ */
.floating-support-btn {
  position: fixed;
  bottom: 30px;
  right: 30px;
  z-index: 999;
}

.support-button {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #ff0080, #ff8c00);
  color: white;
  font-size: 28px;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(255, 0, 128, 0.4);
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.support-button:hover {
  transform: scale(1.1);
  box-shadow: 0 6px 25px rgba(255, 0, 128, 0.6);
}

.support-button:active {
  transform: scale(0.95);
}

.support-menu {
  position: absolute;
  bottom: 80px;
  right: 0;
  background: rgba(15, 15, 25, 0.95);
  border: 1px solid rgba(0, 200, 255, 0.3);
  border-radius: 8px;
  overflow: hidden;
  min-width: 180px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(10px);
  animation: menuSlideUp 0.3s ease-out;
}

.support-menu.hidden {
  display: none;
}

@keyframes menuSlideUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.support-menu-item {
  display: block;
  padding: 12px 16px;
  color: #00ccff;
  text-decoration: none;
  transition: all 0.2s ease;
  border-bottom: 1px solid rgba(0, 200, 255, 0.1);
  font-size: 0.9em;
}

.support-menu-item:last-child {
  border-bottom: none;
}

.support-menu-item:hover {
  background: rgba(0, 150, 200, 0.2);
  color: #00ffcc;
  padding-left: 20px;
}

/* ============ SHARE SECTION ============ */
.share-section {
  background: linear-gradient(135deg, rgba(0, 100, 150, 0.15) 0%, rgba(0, 60, 100, 0.1) 100%);
  border: 2px solid rgba(0, 200, 255, 0.3);
  padding: 30px;
  border-radius: 12px;
  margin-top: 30px;
  box-shadow: 0 8px 32px rgba(0, 100, 150, 0.2);
}

.share-section h3 {
  margin-top: 0;
  color: #00ffff;
  font-size: 1.4em;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.share-section p {
  color: #aaa;
  margin: 15px 0;
  font-size: 0.95em;
}

.copy-link {
  background: rgba(0, 50, 80, 0.6);
  border: 1px solid rgba(0, 200, 255, 0.4);
  padding: 15px;
  border-radius: 8px;
  margin: 15px 0;
  word-break: break-all;
  font-family: monospace;
  font-size: 0.9em;
  color: #00ff88;
  cursor: pointer;
  transition: all 0.3s ease;
}

.copy-link:hover {
  background: rgba(0, 100, 150, 0.4);
  border-color: #00ffff;
  box-shadow: 0 0 15px rgba(0, 255, 255, 0.2);
}

.share-buttons {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
}

.copy-link {
  padding: 10px 15px;
  background: rgba(0, 100, 150, 0.2);
  border: 1px solid rgba(0, 200, 255, 0.3);
  border-radius: 6px;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  color: #00ff88;
  word-break: break-all;
  margin-top: 10px;
}

/* ============ FOOTER ============ */
footer {
  text-align: center;
  padding: 40px 20px;
  border-top: 1px solid rgba(0, 204, 255, 0.1);
  color: #666;
  font-size: 0.9em;
  margin-top: 60px;
}

footer a {
  color: #00ccff;
  text-decoration: none;
  transition: color 0.2s;
}

footer a:hover {
  color: #00ffcc;
}

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

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

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  header h1 {
    font-size: 2em;
  }

  section {
    padding: 25px;
  }

  .axes-grid {
    grid-template-columns: 1fr;
  }

  .options {
    flex-direction: column;
  }

  .option-label {
    min-width: 100%;
  }

  .octant-name {
    font-size: 1.8em;
  }

  #legend {
    padding: 15px;
    max-height: 300px;
  }

  #legend-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .toggle-legend-btn {
    width: 100%;
    justify-content: center;
    font-size: 14px;
    padding: 10px 16px;
  }

  .share-buttons-row {
    flex-direction: column;
  }

  .share-btn {
    width: 100%;
    justify-content: center;
  }

  .button-group {
    flex-direction: column;
  }

  button {
    width: 100%;
  }

  .floating-support-btn {
    bottom: 20px;
    right: 20px;
  }

  .support-button {
    width: 50px;
    height: 50px;
    font-size: 24px;
  }

  .support-menu {
    bottom: 70px;
  }

  .donation-banner {
    padding: 20px;
    margin: 20px auto;
  }

  .donation-links {
    flex-direction: column;
  }

  .donation-link {
    width: 100%;
  }
}

@media (max-width: 480px) {
  header {
    padding: 30px 10px 20px;
  }

  header h1 {
    font-size: 1.5em;
  }

  section {
    padding: 15px;
    margin-bottom: 20px;
  }

  .question {
    padding: 15px;
    margin: 15px 0;
  }

  #canvas-container {
    min-height: 300px;
  }

  .octant-name {
    font-size: 1.4em;
  }

  .ad-banner {
    min-height: 60px;
  }
}

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

@media (prefers-color-scheme: light) {
  body {
    background: linear-gradient(135deg, #f5f5f5 0%, #e0e8f0 100%);
    color: #1a1a1a;
  }

  section {
    background: rgba(240, 240, 250, 0.8);
    border-color: rgba(0, 119, 255, 0.2);
    color: #333;
  }

  .question {
    background: rgba(230, 240, 250, 0.5);
    color: #333;
  }

  .option-label {
    background: rgba(200, 220, 240, 0.3);
    color: #555;
  }

  #legend {
    background: rgba(240, 240, 250, 0.9);
    color: #333;
  }
}

/* ============ ACCESSIBILITY ============ */

/* Visually hidden but accessible to screen readers */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* Focus styles for keyboard navigation */
*:focus {
  outline: 2px solid #00ff88;
  outline-offset: 2px;
}

*:focus:not(:focus-visible) {
  outline: none;
}

*:focus-visible {
  outline: 2px solid #00ff88;
  outline-offset: 2px;
}

/* High contrast mode support */
@media (forced-colors: active) {
  .option-label {
    border: 2px solid CanvasText;
  }
  
  .option-label.selected {
    background: Highlight;
    color: HighlightText;
  }
  
  button {
    border: 2px solid CanvasText;
  }
}

/* Ensure sufficient color contrast for text */
.question-text {
  color: #f0f0f0;
}

/* Make touch targets at least 44x44px for mobile accessibility */
.option-label {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
}

button {
  min-height: 44px;
}

/* Language selector button accessibility */
.lang-btn:focus-visible {
  outline: 3px solid #00ff88;
  outline-offset: 2px;
}

/* Screen reader announcements */
[role="status"],
[role="alert"],
[aria-live] {
  position: relative;
}

/* Ensure links are distinguishable */
a {
  text-decoration: underline;
  text-decoration-color: rgba(0, 200, 255, 0.5);
  text-underline-offset: 3px;
}

a:hover,
a:focus {
  text-decoration-color: #00ccff;
}

/* Question answered indicator for screen readers */
.question.answered {
  border-left-color: #00ff88;
}

.question.answered::after {
  content: "✓";
  position: absolute;
  top: 10px;
  right: 10px;
  color: #00ff88;
  font-size: 1.2em;
}

/* Print styles for accessibility */
@media print {
  body {
    background: white;
    color: black;
  }
  
  section {
    background: white;
    border: 1px solid #ccc;
  }
  
  .lang-selector,
  .floating-support-btn,
  .ezoic-ad,
  #canvas-container {
    display: none !important;
  }
}

