/* ==========================================
   OCD EFFECTS & DREAMCORE STYLES
   ========================================== */

/* ---- Fog Overlay ---- */
.fog-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 5000;
  background: transparent;
  transition: all 2s ease;
}
.fog-overlay.active {
  background: radial-gradient(ellipse at center,
    transparent 30%,
    rgba(100, 80, 140, 0.08) 60%,
    rgba(80, 60, 120, 0.15) 100%
  );
}
.fog-overlay.heavy {
  background: radial-gradient(ellipse at center,
    rgba(60, 40, 100, 0.1) 10%,
    rgba(80, 60, 120, 0.2) 40%,
    rgba(40, 20, 80, 0.35) 100%
  );
}

/* ---- Intrusive Thought Popups ---- */
#intrusive-container {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  z-index: 6000;
}
.intrusive-popup {
  position: absolute;
  background: rgba(20, 10, 40, 0.85);
  color: rgba(200, 180, 255, 0.9);
  padding: 8px 16px;
  border-radius: 4px;
  font-size: 13px;
  font-family: 'Kaiti', 'STKaiti', serif;
  border: 1px solid rgba(120, 80, 200, 0.3);
  box-shadow: 0 0 15px rgba(100, 60, 180, 0.2);
  animation: intrusiveAppear 0.3s ease, intrusiveFade 2s ease forwards;
  pointer-events: none;
  max-width: 250px;
}
@keyframes intrusiveAppear {
  from { opacity: 0; transform: scale(0.8) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes intrusiveFade {
  0% { opacity: 1; }
  70% { opacity: 0.8; }
  100% { opacity: 0; transform: scale(1.05) translateY(-5px); }
}

/* ---- Dreamy text effects ---- */
.ocd-dreamy .icon-label {
  text-shadow: 0 0 4px rgba(200, 180, 255, 0.4), 1px 1px 2px rgba(0,0,0,0.8);
}

/* ---- Glitch effect for high OCD ---- */
@keyframes glitch {
  0% { transform: translate(0); }
  20% { transform: translate(-1px, 1px); }
  40% { transform: translate(1px, -1px); }
  60% { transform: translate(-1px, 0); }
  80% { transform: translate(1px, 1px); }
  100% { transform: translate(0); }
}

/* ---- CRT scanline effect (subtle) ---- */
.desktop.ocd-dreamy::after {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 2px,
    rgba(0, 0, 0, 0.02) 2px,
    rgba(0, 0, 0, 0.02) 4px
  );
  z-index: 9998;
}

/* ---- Vignette for high OCD ---- */
.desktop.ocd-dreamy::before {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  pointer-events: none;
  box-shadow: inset 0 0 100px rgba(0, 0, 0, 0.3);
  z-index: 9997;
}

/* ---- Dreamcore Good Ending Effects ---- */
#good-ending {
  animation: goodEndingFadeIn 2s ease;
}

#good-ending::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse at center,
    rgba(255, 200, 255, 0.05) 0%,
    rgba(200, 150, 255, 0.08) 50%,
    rgba(100, 50, 150, 0.12) 100%
  );
  animation: dreamyPulse 4s ease-in-out infinite;
  pointer-events: none;
}

#good-ending::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: repeating-linear-gradient(
    0deg,
    transparent,
    transparent 3px,
    rgba(200, 150, 255, 0.03) 3px,
    rgba(200, 150, 255, 0.03) 6px
  );
  pointer-events: none;
  animation: scanlineMove 8s linear infinite;
}

@keyframes goodEndingFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes dreamyPulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

@keyframes scanlineMove {
  from { transform: translateY(0); }
  to { transform: translateY(6px); }
}

/* ---- Dreamcore Blog Header Glow ---- */
.blog-header-banner {
  position: relative;
}

.blog-header-banner::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: linear-gradient(180deg,
    rgba(255, 200, 255, 0.1) 0%,
    transparent 50%,
    rgba(200, 150, 255, 0.05) 100%
  );
  pointer-events: none;
  mix-blend-mode: overlay;
}

/* ---- Nostalgic Desktop Wallpaper Effect ---- */
.desktop {
  position: relative;
}

.desktop::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse at 30% 40%,
    rgba(255, 255, 200, 0.03) 0%,
    transparent 50%
  );
  pointer-events: none;
  z-index: 0;
}

/* ---- Dreamy Window Shadows ---- */
.xp-window {
  box-shadow: 
    0 0 0 1px rgba(0, 0, 0, 0.3),
    0 4px 12px rgba(0, 0, 0, 0.2),
    0 0 30px rgba(100, 80, 150, 0.1);
}

/* ---- Kidcore Blog Post Hover Effect ---- */
.post-item:hover {
  background: linear-gradient(90deg,
    rgba(255, 200, 255, 0.05) 0%,
    rgba(200, 255, 200, 0.05) 50%,
    rgba(200, 200, 255, 0.05) 100%
  );
  transition: background 0.3s ease;
}

/* ---- Dreamy Boot Screen ---- */
#boot-screen {
  background: linear-gradient(180deg,
    #000 0%,
    #0a0a1a 50%,
    #000 100%
  );
}

#boot-screen::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse at center,
    rgba(100, 80, 150, 0.05) 0%,
    transparent 70%
  );
  animation: bootGlow 3s ease-in-out infinite;
}

@keyframes bootGlow {
  0%, 100% { opacity: 0.3; }
  50% { opacity: 0.6; }
}

/* ---- Dreamy Final Diary Effect ---- */
#final-diary {
  animation: diaryFadeIn 3s ease;
}

#final-diary::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: radial-gradient(ellipse at center,
    rgba(255, 220, 180, 0.03) 0%,
    rgba(200, 180, 255, 0.05) 50%,
    rgba(150, 100, 200, 0.08) 100%
  );
  animation: diaryPulse 5s ease-in-out infinite;
  pointer-events: none;
}

@keyframes diaryFadeIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes diaryPulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

/* ---- Blinking Cursor for Diary ---- */
.blink-cursor {
  display: inline-block;
  width: 8px;
  height: 16px;
  background: rgba(200, 180, 255, 0.8);
  animation: cursorBlink 1s step-end infinite;
  vertical-align: middle;
  margin-left: 2px;
}

@keyframes cursorBlink {
  0%, 50% { opacity: 1; }
  51%, 100% { opacity: 0; }
}
