/* --- Action is Key Page Styles --- */

/* Theme: Happiness Yellow / Gold */
.page-title-area.theme-yellow {
  text-align: left;
  margin-bottom: 3rem;
}
.page-title-area.theme-yellow .page-title-text {
  color: #eab308; /* Yellow-600 */
}
.page-title-area.theme-yellow .title-underline {
  background: #facc15; /* Yellow-400 */
}

/* Quote Style: Key */
.hero-quote-container.quote-style-key {
  background-image:
    radial-gradient(
      circle at top right,
      rgba(253, 224, 71, 0.2),
      transparent 40%
    ),
    linear-gradient(135deg, #fefce8 0%, #fef9c3 100%);
  border-left: 6px solid #eab308;
  padding: 3rem;
  border-radius: 1rem;
  margin-bottom: 4rem;
  position: relative;
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}
.quote-style-key .quote-icon {
  color: #fde047;
}
.quote-style-key .quote-text {
  color: #854d0e; /* Yellow-900 */
}
.quote-style-key .quote-author {
  color: #ca8a04; /* Yellow-600 */
}

/* Headers & Numbers */
.header-yellow {
  color: #ca8a04;
  border-bottom: 2px solid #fef08a;
}
.num-yellow {
  background: #eab308;
  color: white;
}

/* Highlight Box */
.highlight-box-yellow {
  background: #fffbeb; /* Yellow-50 */
  border: 2px solid #fde047;
  border-radius: 12px;
  padding: 1.5rem;
  margin: 2rem 0;
  text-align: center;
}
.highlight-box-yellow .box-title {
  color: #b45309; /* Amber-700 */
  margin-bottom: 0.5rem;
  font-size: 1.1rem;
}
.highlight-box-yellow .box-text {
  color: #451a03;
  font-size: 1rem;
}

/* Emphasis Text */
.emphasis-text {
  font-weight: bold;
  color: #b45309;
  border-left: 4px solid #f59e0b;
  padding-left: 1rem;
  background: rgba(254, 243, 199, 0.5);
  padding: 0.5rem 1rem;
}

/* Interactive Visual: World Filter */
.world-filter-container {
  background: #1e293b; /* Slate-800 backdrop */
  border-radius: 20px;
  padding: 2rem;
  text-align: center;
  color: white;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  position: relative;
  border: 1px solid #334155;
}

.filter-controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-bottom: 2rem;
}

.filter-btn {
  padding: 0.8rem 1.5rem;
  border: none;
  border-radius: 50px;
  cursor: pointer;
  font-weight: bold;
  transition: all 0.3s ease;
  background: rgba(255, 255, 255, 0.1);
  color: #94a3b8;
}
.filter-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}
.filter-btn.active {
  transform: scale(1.05);
  box-shadow: 0 0 15px rgba(0, 0, 0, 0.3);
  color: white;
}
.filter-btn.negative.active {
  background: #475569; /* Slate-600 */
}
.filter-btn.positive.active {
  background: linear-gradient(135deg, #facc15 0%, #f59e0b 100%);
  color: black;
}

.world-display {
  height: 250px;
  background: linear-gradient(
    to bottom,
    #334155 0%,
    #0f172a 100%
  ); /* Gloomy Sky */
  border-radius: 12px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 1s ease;
  filter: grayscale(100%) contrast(0.8); /* DEFAULT NEGATIVE */
}

/* Visual Elements in World */
.world-content {
  position: relative;
  width: 100%;
  height: 100%;
}
.world-content i {
  position: absolute;
  transition: all 1s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.tree-icon {
  bottom: 20px;
  left: 20px;
  font-size: 5rem;
  color: #22c55e;
  transform: scale(0.8);
}
.sun-icon {
  top: 30px;
  right: 30px;
  font-size: 4rem;
  color: #facc15;
  opacity: 0;
  transform: translateY(20px);
}
.cloud-icon {
  top: 40px;
  left: 40px;
  font-size: 3rem;
  color: #94a3b8;
  opacity: 1;
  animation: drift 10s infinite linear;
}

.world-message {
  position: absolute;
  bottom: 20px;
  right: 20px;
  background: rgba(0, 0, 0, 0.6);
  padding: 1rem;
  border-radius: 8px;
  font-size: 1rem;
  line-height: 1.4;
  transition: all 0.5s ease;
}

/* Positive State */
.world-display.colorful {
  filter: grayscale(0%) contrast(1.1);
  background: linear-gradient(
    to bottom,
    #60a5fa 0%,
    #cffafe 100%
  ); /* Blue Sky */
}
.world-display.colorful .sun-icon {
  opacity: 1;
  transform: translateY(0) rotate(180deg);
  /* Sun rotates in */
}
.world-display.colorful .tree-icon {
  transform: scale(1.1);
}
.world-display.colorful .cloud-icon {
  opacity: 0.6;
  color: white;
}
.world-display.colorful .world-message {
  background: rgba(255, 255, 255, 0.8);
  color: #0f172a;
  font-weight: bold;
}

.caption-text {
  text-align: center;
  margin-top: 1rem;
  color: #64748b;
  font-size: 0.9rem;
}

@keyframes drift {
  0% {
    transform: translateX(0);
  }
  50% {
    transform: translateX(20px);
  }
  100% {
    transform: translateX(0);
  }
}

/* Key Concept Section */
.key-concept {
  text-align: center;
  margin: 3rem 0;
  padding: 2rem;
  border: 3px double #eab308;
  border-radius: 50%;
  width: 200px;
  height: 200px;
  margin-left: auto;
  margin-right: auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: #fff;
  box-shadow: 0 10px 25px rgba(234, 179, 8, 0.2);
  position: relative;
  overflow: hidden;
}
.key-concept::before {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, rgba(253, 224, 71, 0.2), transparent 70%);
  animation: pulse-glow 3s infinite;
}

.key-icon {
  font-size: 3rem;
  color: #eab308;
  margin-bottom: 0.5rem;
  transform: rotate(45deg);
  transition: transform 0.5s ease;
}
.key-concept:hover .key-icon {
  transform: rotate(225deg); /* Turn the key */
}

/* Conclusion Box */
.conclusion-box {
  margin-top: 4rem;
  background: #fefce8;
  padding: 3rem;
  border-radius: 1rem;
  text-align: center;
  border: 1px solid #fef08a;
}
.conclusion-text {
  font-weight: bold;
  color: #854d0e;
  margin-bottom: 2rem;
}
.divider-yellow {
  border: 0;
  height: 1px;
  background: #eab308;
  margin: 2rem auto;
  width: 50px;
}
.final-quote {
  font-family: "Zen Old Mincho", serif;
  font-size: 1.1rem;
  color: #a16207;
  line-height: 2;
}

/* Sidebar Advice Yellow */
.sidebar-advice.advice-yellow .header i {
  color: #eab308;
}
.advice-highlight-yellow {
  color: #eab308;
  font-weight: bold;
  background: linear-gradient(transparent 60%, rgba(253, 224, 71, 0.4) 60%);
}

/* --- Brush-up Enhancements for Action is Key --- */

/* 1. Golden Key Shine Animation */
.key-concept .key-icon {
  position: relative; /* Ensure relative pos for pseudo-element if needed, though icon is likely fine */
  animation: gold-shine 5s infinite;
}

@keyframes gold-shine {
  0%,
  80% {
    text-shadow: none;
    transform: rotate(45deg);
    color: #eab308;
  }
  85% {
    text-shadow:
      0 0 10px #fef08a,
      0 0 20px #facc15;
    transform: rotate(45deg) scale(1.1);
    color: #fefce8; /* Flash white-ish */
  }
  90% {
    text-shadow: 0 0 5px #fef08a;
    transform: rotate(45deg) scale(1);
    color: #eab308;
  }
  100% {
    text-shadow: none;
    transform: rotate(45deg);
    color: #eab308;
  }
}

/* Key Text Styles */
.key-label {
  font-size: 0.9rem;
  color: #b45309;
  margin-bottom: 0.3rem;
}
.key-value {
  font-size: 1.2rem;
  color: #713f12;
}

/* 2. Positive World Expansion */
#action-content {
  transition: background-color 1.5s ease;
  border-radius: 20px;
  padding: 1rem; /* Add padding to make bg visible nicely */
}

#action-content.positive-mode {
  background-color: #fffbeb; /* Very light warm yellow */
  box-shadow: 0 0 50px rgba(253, 224, 71, 0.1) inset;
}

/* 3. Footsteps Animation */
.footsteps-container {
  display: flex;
  justify-content: center;
  gap: 2rem;
  margin-top: 1.5rem;
  height: 40px; /* Reserve space */
}

.footstep {
  font-size: 1.5rem;
  color: #f97316; /* Orange footsteps */
  opacity: 0;
  transform: rotate(-15deg);
}

.footstep.f2 {
  transform: rotate(15deg) translateY(-10px);
}

/* Animate footsteps when container is revealed (or always if visible) */
/* Ideally needs a trigger, but using standard animation for now */
.footsteps-container .footstep {
  animation: footstep-walk 3s infinite;
}

.footsteps-container .f1 {
  animation-delay: 0s;
}
.footsteps-container .f2 {
  animation-delay: 0.5s;
}
.footsteps-container .f3 {
  animation-delay: 1s;
}

@keyframes footstep-walk {
  0% {
    opacity: 0;
    transform: scale(0.5);
  }
  20% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
  80% {
    opacity: 0;
  }
  100% {
    opacity: 0;
  }
}

/* --- Rolling Key Animation Styles --- */

.rolling-key-container {
  width: 100%;
  max-width: 600px;
  margin: 3rem auto;
  padding: 2rem;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
  border: 1px solid #fef08a;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  user-select: none;
}

.key-track {
  position: relative;
  height: 80px;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
}

.track-line {
  position: absolute;
  bottom: 10px;
  left: 0;
  width: 100%;
  height: 4px;
  background: #e2e8f0;
  border-radius: 2px;
  z-index: 0;
}

/* Light Path (Hidden initially) */
.track-line::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 0%;
  background: #facc15;
  box-shadow: 0 0 10px #facc15;
  transition: width 2s cubic-bezier(0.45, 0.05, 0.55, 0.95);
  z-index: 1;
}

.rolling-object {
  position: absolute;
  left: 0;
  bottom: 0px; /* Adjust based on icon size to sit on line */
  z-index: 2;
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: left 2s cubic-bezier(0.45, 0.05, 0.55, 0.95);
}

.key-icon-large {
  font-size: 3rem;
  color: #eab308;
  /* Default rotation */
  transform: rotate(45deg);
  transition: transform 2s linear; /* Should match move duration roughly, or be handled by animation */
}

/* Rolling State */
.rolling-key-container.active .rolling-object {
  left: calc(100% - 60px); /* Move to end */
}

.rolling-key-container.active .track-line::after {
  width: 100%;
}

.rolling-key-container.active .key-icon-large {
  animation: key-roll 2s linear forwards;
}

@keyframes key-roll {
  0% {
    transform: rotate(45deg);
  }
  100% {
    transform: rotate(765deg);
  } /* 2 full turns + 45 */
}

/* Message Area */
.key-message-area {
  text-align: center;
  position: relative;
  height: 3rem; /* Fixed height to prevent jump */
}

.message-text {
  font-size: 1.2rem;
  font-weight: bold;
  color: #b45309;
  transition: opacity 0.3s ease;
}

.click-hint {
  font-size: 0.8rem;
  color: #94a3b8;
  margin-top: 0.2rem;
  animation: bounce-hint 1s infinite;
}

.rolling-key-container.active .click-hint {
  display: none;
}

@keyframes bounce-hint {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

/* Key Shine Effect (Reusing/Adjusting existing if needed, or defined here) */
.rolling-key-container:not(.active) .key-icon-large {
  animation: gold-shine-static 3s infinite;
}

@keyframes gold-shine-static {
  0%,
  90% {
    text-shadow: none;
    color: #eab308;
  }
  95% {
    text-shadow: 0 0 15px #fef08a;
    color: #fefce8;
  }
  100% {
    text-shadow: none;
    color: #eab308;
  }
}

/* --- Unlock Door Animation Styles --- */

.unlock-door-container {
  width: 100%;
  max-width: 600px;
  margin: 3rem auto;
  padding: 3rem 2rem;
  background: #fdfdfd;
  border-radius: 12px;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
  border: 1px solid #fef08a;
  cursor: pointer;
  overflow: hidden;
  position: relative;
  user-select: none;
  min-height: 250px;
}

.key-animation-area {
  position: relative;
  height: 120px;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  background: #f8fafc;
  border-radius: 8px;
  overflow: hidden; /* Important for hiding key when inserted if needed, though we want it visible */
}

/* 1. Key Element */
.door-key-element {
  position: absolute;
  left: 20px; /* Start pos */
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
  color: #eab308;
  z-index: 10;
  transition:
    left 1s cubic-bezier(0.45, 0.05, 0.55, 0.95),
    transform 0.5s ease 1s; /* Transform waits for move */
}

/* 2. Keyhole / Target */
.door-target {
  position: absolute;
  right: 50px; /* Target pos */
  top: 50%;
  transform: translateY(-50%);
  width: 60px;
  height: 60px;
  background: #e2e8f0;
  border-radius: 50%;
  box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
  z-index: 5;
  display: flex;
  justify-content: center;
  align-items: center;
}

.keyhole-outer {
  width: 30px;
  height: 30px;
  background: #475569;
  border-radius: 50%;
  position: relative;
}

.keyhole-inner {
  width: 4px;
  height: 15px;
  background: #0f172a;
  position: absolute;
  bottom: -5px;
  left: 50%;
  transform: translateX(-50%);
}
.keyhole-outer::before {
  content: "";
  position: absolute;
  top: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 10px;
  height: 10px;
  background: #0f172a;
  border-radius: 50%;
}

/* 3. Door Panels (Hidden initially) */
.door-panels {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1; /* Behind keyhole */
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.door-left,
.door-right {
  position: absolute;
  top: 0;
  width: 50%;
  height: 100%;
  background: #e2e8f0;
  border: 1px solid #cbd5e1;
  transition: transform 1.5s ease-in-out;
}
.door-left {
  left: 0;
  transform-origin: left;
}
.door-right {
  right: 0;
  transform-origin: right;
}

.door-light {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: radial-gradient(circle, #fefce8 0%, #fef08a 100%);
  z-index: -1;
  opacity: 0;
  transition: opacity 1s ease 0.5s;
}

/* --- ANIMATION STATES --- */

/* State 1: Move Key to Hole */
/* Only triggers when .unlocking is added via JS click */
.unlock-door-container.unlocking .door-key-element {
  left: calc(
    100% - 110px
  ); /* Move to align with keyhole (right:50px + center adjustment) */
}

/* State 2: Insert (Scale down slightly) & Turn */
.unlock-door-container.unlocking .door-key-element {
  animation: key-insert-turn 2.5s forwards;
}

@keyframes key-insert-turn {
  0% {
    transform: translateY(-50%) scale(1) rotate(0deg);
  }
  40% {
    transform: translateY(-50%) scale(1) rotate(0deg);
  } /* Move complete */
  50% {
    transform: translateY(-50%) scale(0.6) rotate(0deg);
  } /* Insert */
  60% {
    transform: translateY(-50%) scale(0.6) rotate(0deg);
  } /* Pause */
  100% {
    transform: translateY(-50%) scale(0.6) rotate(90deg);
  } /* Turn */
}

/* State 3: Open Door */
.unlock-door-container.door-open .door-target {
  opacity: 0;
  transition: opacity 0.5s ease;
}

.unlock-door-container.door-open .door-key-element {
  opacity: 0;
  transition: opacity 0.5s ease;
}

.unlock-door-container.door-open .door-panels {
  opacity: 1;
}

.unlock-door-container.door-open .door-left {
  transform: perspective(1000px) rotateY(-110deg);
}
.unlock-door-container.door-open .door-right {
  transform: perspective(1000px) rotateY(110deg);
}
.unlock-door-container.door-open .door-light {
  opacity: 1;
}

/* Make sure text fades out during transition */
#unlock-message-text {
  transition: opacity 0.3s ease;
}

.click-hint {
  animation: bounce 1s infinite;
}
.unlock-door-container.unlocking .click-hint {
  display: none;
}

/* --- Door Internal Message (Replaces Button) --- */
.door-light {
  display: flex;
  align-items: center;
  justify-content: center;
}

.door-inner-message {
  text-align: center;
  color: #eab308; /* Darker Gold for visibility against light bg */
  font-weight: 800;
  font-size: 1.5rem;
  line-height: 1.8;
  opacity: 0;
  transform: scale(0.8);
  transition: all 1s ease 0.8s; /* Delay to appear after door opens */
  text-shadow:
    0 0 5px rgba(255, 255, 255, 0.8),
    0 0 10px rgba(255, 255, 255, 0.5);
  white-space: nowrap;
}

.unlock-door-container.door-open .door-inner-message {
  opacity: 1;
  transform: scale(1);
}

/* Ensure any old button styles don't conflict (by overriding or ignoring) */
.door-link-btn {
  display: none;
}
