/* ==========================================================
   Yazı efektleri — yazılarda ve editör önizlemesinde kullanılır.
   Panel'deki "Efekt kütüphanesi" bu sınıfları ekler.
   ========================================================== */

/* ---------- Glitch ---------- */
.glitch { position: relative; display: inline-block; font-weight: 700; color: var(--text); }
.glitch::before, .glitch::after {
  content: attr(data-text); position: absolute; inset: 0; pointer-events: none;
}
.glitch::before { color: #ff3c6e; transform: translate(-2px, 0); clip-path: inset(0 0 60% 0); animation: glitch-a 2.4s infinite steps(1); mix-blend-mode: screen; }
.glitch::after { color: #3cf0ff; transform: translate(2px, 0); clip-path: inset(55% 0 0 0); animation: glitch-b 1.9s infinite steps(1); mix-blend-mode: screen; }
@keyframes glitch-a {
  0% { clip-path: inset(0 0 70% 0); transform: translate(-2px, -1px); }
  20% { clip-path: inset(30% 0 40% 0); transform: translate(3px, 1px); }
  40% { clip-path: inset(70% 0 5% 0); transform: translate(-3px, 0); }
  60% { clip-path: inset(10% 0 80% 0); transform: translate(1px, -1px); }
  80% { clip-path: inset(50% 0 20% 0); transform: translate(-1px, 2px); }
  100% { clip-path: inset(0 0 70% 0); transform: translate(-2px, -1px); }
}
@keyframes glitch-b {
  0% { clip-path: inset(60% 0 10% 0); transform: translate(2px, 1px); }
  25% { clip-path: inset(5% 0 75% 0); transform: translate(-3px, 0); }
  50% { clip-path: inset(40% 0 30% 0); transform: translate(2px, -1px); }
  75% { clip-path: inset(80% 0 0 0); transform: translate(-1px, 1px); }
  100% { clip-path: inset(60% 0 10% 0); transform: translate(2px, 1px); }
}

/* ---------- Neon ---------- */
.neon-text, .neon-cyan { color: #e8fdff; text-shadow: 0 0 4px #6ee6ff, 0 0 12px #6ee6ff, 0 0 28px #1fb8e0; font-weight: 600; }
.neon-pink { color: #fff0f8; text-shadow: 0 0 4px #ff5cc8, 0 0 12px #ff5cc8, 0 0 28px #d61f9a; font-weight: 600; }
.neon-green { color: #f0fff4; text-shadow: 0 0 4px #4dff88, 0 0 12px #4dff88, 0 0 28px #12c050; font-weight: 600; }
.neon-flicker { animation: flicker 3.2s infinite; }
@keyframes flicker { 0%, 18%, 22%, 25%, 53%, 57%, 100% { opacity: 1; } 20%, 24%, 55% { opacity: 0.35; } }

/* ---------- Daktilo ---------- */
.typing-effect {
  display: inline-block; font-family: var(--mono); color: var(--wake);
  white-space: nowrap; overflow: hidden; vertical-align: bottom;
  border-right: 2px solid var(--wake);
  width: calc(var(--chars, 20) * 1ch + 2px);
  animation: typing calc(var(--chars, 20) * 80ms) steps(var(--chars, 20)) 0.3s both, caret 0.8s step-end infinite;
}
@keyframes typing { from { width: 0; } }
@keyframes caret { 50% { border-color: transparent; } }

/* ---------- Renkli metinler ---------- */
.rainbow {
  background: linear-gradient(90deg, #ff5c5c, #ffb84d, #f5f05a, #5cff8a, #5ce1ff, #8a7dff, #ff5cc8, #ff5c5c);
  background-size: 200% auto; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: slide 4s linear infinite; font-weight: 700;
}
.cyber-gradient {
  background: linear-gradient(90deg, #6ee6ff, #8a7dff, #ff5cc8);
  -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 700;
}
.fire-text {
  background: linear-gradient(0deg, #ff3b1f, #ff9a1f, #ffe45c);
  -webkit-background-clip: text; background-clip: text; color: transparent; font-weight: 700;
  filter: drop-shadow(0 0 6px rgba(255, 120, 40, 0.5));
}
@keyframes slide { to { background-position: 200% center; } }

/* ---------- Hareket ---------- */
.shake { display: inline-block; animation: shake 0.6s infinite; }
@keyframes shake { 0%, 100% { transform: translate(0); } 25% { transform: translate(-1px, 1px) rotate(-1deg); } 50% { transform: translate(1px, -1px); } 75% { transform: translate(-1px, 0) rotate(1deg); } }
.pulse { display: inline-block; animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.08); opacity: 0.75; } }
.blink { animation: blink 1s steps(1) infinite; }
.float { display: inline-block; animation: float 2.4s ease-in-out infinite; }
@keyframes float { 50% { transform: translateY(-4px); } }
.wave { display: inline-block; }
.wave .wave-ch { display: inline-block; animation: wave 1.4s ease-in-out infinite; animation-delay: calc(var(--i) * 70ms); white-space: pre; }
@keyframes wave { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-6px); } }
.scramble { font-family: var(--mono); color: var(--ok); }

/* ---------- İşaretleme ve vurgu ---------- */
.prose mark, .hl-yellow { background: linear-gradient(transparent 15%, rgba(255, 220, 60, 0.38) 15%, rgba(255, 220, 60, 0.38) 85%, transparent 85%); color: inherit; padding: 0 2px; }
.hl-cyan { background: linear-gradient(transparent 15%, rgba(110, 230, 255, 0.3) 15%, rgba(110, 230, 255, 0.3) 85%, transparent 85%); padding: 0 2px; }
.hl-pink { background: linear-gradient(transparent 15%, rgba(255, 92, 200, 0.32) 15%, rgba(255, 92, 200, 0.32) 85%, transparent 85%); padding: 0 2px; }
.hl-green { background: linear-gradient(transparent 15%, rgba(77, 255, 136, 0.28) 15%, rgba(77, 255, 136, 0.28) 85%, transparent 85%); padding: 0 2px; }
.wavy { text-decoration: underline wavy var(--danger); text-underline-offset: 4px; }
.prose u { text-decoration-color: var(--wake); text-underline-offset: 4px; }
.prose em, .prose i { font-style: italic; }
.text-big { font-size: 1.5em; line-height: 1.3; font-weight: 600; }
.text-huge { font-size: 2.4em; line-height: 1.1; font-weight: 700; letter-spacing: -0.02em; display: block; }
.text-small { font-size: 0.8em; color: var(--muted); }
.center { text-align: center; display: block; }

/* ---------- Sansür / gizli ---------- */
.redacted { background: var(--text); color: transparent; border-radius: 2px; padding: 0 4px; cursor: pointer; transition: background-color 300ms var(--ease), color 300ms var(--ease); user-select: none; }
.redacted:hover, .redacted.shown { background: transparent; color: var(--danger); user-select: text; }
.prose .spoiler { display: inline-block; }

/* ---------- Etiketler ---------- */
.label { display: inline-block; padding: 0 8px; border-radius: 9999px; font-size: 0.75em; line-height: 1.7; font-weight: 600; vertical-align: 0.1em; border: 1px solid currentColor; }
.label-red { color: #ff6b5e; } .label-green { color: #7ee2a8; } .label-blue { color: #6ee6ff; }
.label-yellow { color: #f2c98a; } .label-purple { color: #c9b8ff; } .label-gray { color: var(--muted); }

/* ---------- Kutular ---------- */
.prose .alert-box { position: relative; padding: 16px 16px 16px 48px; }
.prose .alert-box::before { position: absolute; left: 16px; top: 15px; font-size: 18px; line-height: 24px; }
.prose .alert-info { border-color: rgba(110, 230, 255, 0.45); color: #d3f6ff; } .prose .alert-info::before { content: "ℹ️"; }
.prose .alert-warning { border-color: rgba(242, 201, 138, 0.5); color: #fbe7c6; } .prose .alert-warning::before { content: "⚠️"; }
.prose .alert-danger::before { content: "🚨"; }
.prose .alert-success::before { content: "✅"; }
.prose .alert-tip { border-color: rgba(201, 184, 255, 0.45); color: #e8e0ff; } .prose .alert-tip::before { content: "💡"; }

.prose .terminal { border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #0a0a0a; }
.prose .terminal::before {
  content: attr(data-title); display: block; padding: 8px 16px 8px 64px; position: relative;
  font-family: var(--mono); font-size: 12px; line-height: 16px; color: var(--faint);
  background-color: var(--surface);
  background-image: radial-gradient(circle at 18px 50%, #ff5f56 5px, transparent 5.5px),
                    radial-gradient(circle at 34px 50%, #ffbd2e 5px, transparent 5.5px),
                    radial-gradient(circle at 50px 50%, #27c93f 5px, transparent 5.5px);
  border-bottom: 1px solid var(--line);
}
.prose .terminal > :not(.code) { margin: 0; padding: 16px; font-family: var(--mono); font-size: 14px; line-height: 22px; color: #dcdcdc; }
.prose .terminal .code { border: 0; border-radius: 0; }
.prose .terminal .code__bar { display: none; }

.prose .flag-box { font-family: var(--mono); padding: 12px 16px; border-radius: 12px; border: 1px dashed rgba(77, 255, 136, 0.5); background: rgba(77, 255, 136, 0.06); color: var(--ok); }
.prose .flag-box::before { content: "🚩 "; }

.prose .big-quote { font-size: 1.5em; line-height: 1.35; font-weight: 600; color: var(--text); border: 0; background: none; padding: 0 0 0 24px; position: relative; }
.prose .big-quote::before { content: ""; position: absolute; left: 0; top: 4px; bottom: 4px; width: 3px; border-radius: 3px; background: linear-gradient(var(--wake), #8a7dff); }

/* Açılır kapanır bölüm */
.prose details { border: 1px solid var(--line); border-radius: 12px; background: var(--surface); padding: 0 16px; }
.prose details > summary { cursor: pointer; padding: 12px 0; font-weight: 600; color: var(--text); list-style: none; display: flex; align-items: center; gap: 8px; }
.prose details > summary::-webkit-details-marker { display: none; }
.prose details > summary::before { content: "▸"; color: var(--wake); transition: transform 300ms var(--ease); }
.prose details[open] > summary::before { transform: rotate(90deg); }
.prose details[open] { padding-bottom: 16px; }
.prose details > :not(summary) + * { margin-top: 16px; }

/* ---------- GIF ve görseller ---------- */
.prose figure { margin-left: 0; margin-right: 0; }
.prose figure.gif { text-align: center; }
.prose figure.gif img { display: inline-block; max-width: 100%; }
.prose .gif-sm img { width: 240px; }
.prose .gif-md img { width: 420px; }
.prose .gif-full img { width: 100%; }
.prose figcaption { margin-top: 8px; color: var(--faint); font-size: 14px; line-height: 20px; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  .glitch::before, .glitch::after { display: none; }
  .typing-effect { width: auto; border-right: 0; }
}
