/* Fluid container for Yin-Yang and message panel */
#main-content-wrapper {
  position: absolute;
  top: 48px;
  width: 100vw;
  height: calc(100dvh - 48px);
  display: flex;
  flex-direction: row;
  align-items: center;
  overflow: hidden;
}
.yin-yang-section {
  display: flex;
  flex-wrap: nowrap;
  justify-content: center;
  align-items: center;
  order: 1;
  margin: 20px 0;
  height: auto;
  opacity: 0;
  transform: translateY(30px);
  transition: all 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.yin-yang-section.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Section transition overlay */
.section-transition-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, rgba(0,0,0,0.8), rgba(0,0,0,0.9));
  opacity: 0;
  visibility: hidden;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(10px);
  transition: all 0.8s ease;
}

.section-transition-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Initial page load overlay */
.page-load-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(45deg, rgba(0,0,0,0.8), rgba(0,0,0,0.9));
  opacity: 1;
  visibility: visible;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(20px);
  transition: all 1s ease;
}

.page-load-overlay.hidden {
  opacity: 0;
  visibility: hidden;
}

.section-transition-content {
  text-align: center;
  color: white;
  font-size: 24px;
  font-weight: 300;
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, 'Liberation Sans', sans-serif;
  animation: pulse 1s ease-in-out infinite alternate;
}

.yin-yang-mini {
  width: 40px;
  height: 40px;
  margin: 0 auto 20px;
  animation: spin 2s linear infinite;
  border-radius: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

/* Pulse animation for transition text */
@keyframes pulse {
  from {
    opacity: 0.6;
    transform: scale(0.95);
  }
  to {
    opacity: 1;
    transform: scale(1.05);
  }
}

/* Spin animation for mini yin-yang */
@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
canvas {
  width: 65vmin;
  height: 65vmin;
  margin: 0 20px;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), 
              inset 0 1px 0 rgba(255, 255, 255, 0.3),
              0 2px 16px rgba(255, 184, 133, 0.15);
  order: 2;
  transition: all 0.3s ease;
}

/* Make the composite canvas square instead of circular */
#canvas-everywhere {
  border-radius: 12px;
}

/* Carousel indicators */
#carousel-indicators {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 4px 0;
}

.indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background-color: rgba(255, 255, 255, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: all 0.3s ease;
}

.indicator:hover {
  background-color: rgba(255, 255, 255, 0.6);
  border-color: rgba(255, 255, 255, 0.8);
  transform: scale(1.1);
}

.indicator.active {
  background-color: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 1);
  transform: scale(1.2);
}

#nav-buttons {
  position: absolute;
  bottom: 32px;
  display: flex;
  gap: 24px;
}
#nav-buttons button {
  font-size: 1.2em;
  padding: 10px 32px;
  border-radius: 8px;
  border: none;
  background: linear-gradient(90deg, #ffd6c0 0%, #ff8c42 100%);
  color: #a85c00;
  border: 2px solid #fff6e0;
  box-shadow: 0 4px 16px rgba(255, 184, 133, 0.15);
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.12);
  transition: background 0.2s;
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, 'Liberation Sans', sans-serif;
  background: rgba(255, 245, 230, 0.95);
  color: #d97706;
  border-radius: 18px;
  box-shadow: 0 4px 16px rgba(255, 184, 133, 0.10);
  border: 2px solid #ffe5b9;
  transition: box-shadow 0.2s, background 0.2s;
}
#nav-buttons button:disabled {
  background: #e5e5e5;
  color: #b8b8b8;
  border: 2px solid #cccccc;
  box-shadow: none;
  cursor: not-allowed;
}
#message-panel {
  position: static;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), 
              inset 0 1px 0 rgba(255, 255, 255, 0.3),
              0 2px 16px rgba(255, 184, 133, 0.15);
  color: #2d3748;
  padding: 30px;
  border-radius: 24px;
  font-size: 1.2em;
  box-sizing: border-box;
  width: 65vmin;
  height: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: left;
  pointer-events: none;
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, 'Liberation Sans', sans-serif;
  align-self: center;
  order: 2;
  line-height: 1.6;
  font-weight: 400;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
  transition: all 0.3s ease;
  margin-right: 20px;
}

@media (max-width: 900px) and (min-width: 601px) {
  #main-content-wrapper {
    flex-direction: column;
    height: calc(100dvh - 48px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    overscroll-behavior-y: none;
    -webkit-overscroll-behavior: none;
    -webkit-overscroll-behavior-y: none;
  }
  
  canvas {
    width: min(70vw, 50vh);
    height: min(70vw, 50vh);
    margin: 10px auto;
    flex-shrink: 0;
  }
  
  #message-panel {
    width: min(90vw, 600px);
    margin: 0 20px 20px 20px;
    padding: 25px;
    font-size: 1.1em;
    flex-shrink: 0;
  }
  
  .yin-yang-section {
    margin: 10px 0;
  }
  
  .yin-arrow {
    margin: 0 15px;
  }
}

@media (max-width: 600px) {
  #main-content-wrapper {
    flex-direction: column;
    overflow-y: auto;
    height: calc(100dvh - 48px);
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    overscroll-behavior-y: none;
    -webkit-overscroll-behavior: none;
    -webkit-overscroll-behavior-y: none;
  }
  /* Mobile vertical: Yin-Yang below title bar, message panel fills rest */
  canvas {
    width: min(90vw, 60vh);
    height: min(90vw, 60vh);
    aspect-ratio: 1 / 1;
    max-width: 220px;
    max-height: 220px;
    min-width: 120px;
    min-height: 120px;
    flex-shrink: 0;
    display: block;
  }
  #nav-buttons {
    bottom: 16px;
    gap: 16px;
  }
  #nav-buttons button {
    padding: 8px 24px;
    font-size: 1em;
  } 
  #message-panel {
    font-size: 1em;
    width: 95vw;
    min-width: unset;
    max-width: unset;
    text-align: left;
    align-items: flex-start;
    justify-content: flex-start;
    padding: 20px;
    border-radius: 16px;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    margin: 0 auto 20px auto;
  }
}

/* Title bar styles */
#title-bar {
  width: 100vw;
  background: linear-gradient(90deg, #ffe5b9 0%, #ffb085 100%);
  color: #a85c00;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  padding: 0px 12px 0px 12px;
  box-sizing: border-box;
  position: absolute;
  top: 0;
  left: 0;
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, 'Liberation Sans', sans-serif;
}

#page-title {
  font-size: 1.4em;
  font-weight: bold;
  letter-spacing: 1.2px;
  font-family: 'Segoe UI', 'Helvetica Neue', Arial, 'Liberation Sans', sans-serif;
  color: #c75a0a;
  text-shadow: 0 2px 8px rgba(255, 140, 66, 0.08);
  align-self: center;
}

/* Auto-play button styles */
#autoplay-button {
  background: linear-gradient(135deg, rgba(255, 140, 66, 0.8), rgba(255, 100, 40, 0.9));
  border: 3px solid rgba(255, 255, 255, 0.9);
  padding: 6px;
  margin-left: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.3s ease;
  color: white;
  box-shadow: 0 4px 15px rgba(255, 140, 66, 0.3),
              inset 0 1px 0 rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}

#autoplay-button:hover {
  background: linear-gradient(135deg, rgba(255, 140, 66, 1), rgba(255, 100, 40, 1));
  box-shadow: 0 6px 20px rgba(255, 140, 66, 0.5),
              inset 0 1px 0 rgba(255, 255, 255, 0.3);
  border-color: rgba(255, 255, 255, 0.9);
}

#autoplay-button.active {
  background: linear-gradient(135deg, rgba(46, 204, 113, 0.9), rgba(39, 174, 96, 1));
  animation: pulse-autoplay 2s infinite;
  border-color: rgba(255, 255, 255, 0.9);
  box-shadow: 0 4px 20px rgba(46, 204, 113, 0.4),
              inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

@keyframes pulse-autoplay {
  0% { 
    box-shadow: 0 4px 20px rgba(46, 204, 113, 0.4),
                0 0 0 0 rgba(46, 204, 113, 0.6),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
  }
  50% { 
    box-shadow: 0 4px 20px rgba(46, 204, 113, 0.4),
                0 0 0 12px rgba(46, 204, 113, 0.1),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
  }
  100% { 
    box-shadow: 0 4px 20px rgba(46, 204, 113, 0.4),
                0 0 0 0 rgba(46, 204, 113, 0),
                inset 0 1px 0 rgba(255, 255, 255, 0.3);
  }
}

#autoplay-button svg {
  display: block;
  width: 24px;
  height: 24px;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.2));
}

#autoplay-button svg path,
#autoplay-button svg circle {
  fill: currentColor;
}

@media (max-width: 600px) {
  #title-bar {
    align-items: stretch;
  }
  #autoplay-button {
    position: absolute;
    right: 12px;
    top: 4px;
  }
  #page-title {
    font-size: 1.2em;
  }
}

body {
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  height: 100vh;
  background: linear-gradient(135deg, #fff6e0 0%, #ffd6c0 50%, #ffb085 100%);
  /* iOS scrolling fixes */
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* Enable scrolling on mobile devices */
@media (max-width: 900px) {
  body {
    overflow: visible;
  }
}

.yin-arrow {
  width: 44px;
  height: 44px;
  background: linear-gradient(135deg, #fff6e0 0%, #ffd6c0 100%);
  border-radius: 50%;
  border: 2px solid #ffe5b9;
  box-shadow: 0 2px 8px rgba(255,184,133,0.10);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: box-shadow 0.2s, background 0.2s, opacity 0.2s;
  margin: 0 2vw;
  opacity: 1;
  pointer-events: auto;
}
.yin-arrow.left {
  margin-right: 2vw;
  order: 1
}
.yin-arrow.right {
  margin-left: 2vw;
  order: 3;
}
.yin-arrow:disabled {
  opacity: 0.55;
  background: #ededed;
  border-color: #dddddd;
  color: #b8b8b8;
  box-shadow: none;
  cursor: not-allowed;
  pointer-events: none;
}
.yin-arrow:disabled svg {
  fill: #b8b8b8;
}
.yin-arrow svg {
  width: 24px;
  height: 24px;
  fill: #d97706;
}
.yin-arrow:active {
  box-shadow: 0 4px 16px rgba(255,184,133,0.18);
  background: #ffd6c0;
}
@media (max-width: 600px) {
  .yin-arrow {
    width: 36px;
    height: 36px;
    margin: 0 1vw;
  }
  .yin-arrow.left {
    margin-right: 1vw;
  }
  .yin-arrow.right {
    margin-left: 1vw;
  }
  .yin-arrow svg {
    width: 20px;
    height: 20px;
  }
}

/* Carousel indicators - positioned below the canvas */
#carousel-indicators {
  position: absolute;
  top: calc(50vh + 35vmin); /* Position below the canvas, using vh to center relative to canvas */
  left: 50vw; /* Center horizontally relative to viewport width */
  transform: translateX(-50%);
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  z-index: 10;
}

.indicator {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.4);
  border: 2px solid rgba(255, 255, 255, 0.6);
  cursor: pointer;
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.indicator.active {
  background: rgba(255, 184, 133, 0.9);
  border: 2px solid #ff8c42;
  width: 16px;
  height: 16px;
  box-shadow: 0 2px 8px rgba(255, 140, 66, 0.3);
}

.indicator:hover {
  background: rgba(255, 184, 133, 0.6);
  border: 2px solid rgba(255, 140, 66, 0.8);
  transform: scale(1.1);
}

@media (max-width: 900px) {
  #carousel-indicators {
    position: static; /* Change from absolute to static positioning */
    transform: none; /* Remove transform since we're not using absolute positioning */
    margin: 20px auto; /* Center horizontally and add vertical spacing */
    order: 2; /* Place between canvas (order 1) and message panel (order 3) */
    gap: 10px;
  }
  
  .yin-yang-section {
    order: 1; /* Canvas section first */
  }
  
  #message-panel {
    order: 3; /* Message panel last */
  }
}

@media (max-width: 600px) {
  #carousel-indicators {
    gap: 8px; /* Smaller gap for mobile */
  }
  
  .indicator {
    width: 10px;
    height: 10px;
  }
  
  .indicator.active {
    width: 14px;
    height: 14px;
  }
}