/* ==========================================================================
   DersTeders - Simülasyon Eğitim Katmanı (Sim Eğitim)
   PLC, devre, breadboard ve Arduino simülatörlerine eklenen eğitim modu.
   Rehber, görev, ipucu, bileşen bilgi kartı ve hazır devre galerisi.
   Mevcut simülasyon motorlarına dokunmadan, üzerine bindirilmiş (overlay)
   katman olarak çalışır. Tema değişkenleriyle uyumludur.
   ========================================================================== */

:root {
  --se-accent: var(--accent, #00D4AA);
  --se-accent-2: var(--accent-2, #00B894);
  --se-accent-dim: rgba(0, 212, 170, .14);
  --se-gold: #F2B705;
  --se-danger: #FF5C5C;
  --se-ok: #35D07F;
  --se-surface: #1E1E22;
  --se-surface-2: #26262B;
  --se-surface-3: #2E2E34;
  --se-border: rgba(255, 255, 255, .1);
  --se-ink: #EAF2F1;
  --se-muted: #9FB0B5;
  --se-radius: 14px;
  --se-z: 2400;
  --se-shadow: 0 22px 60px rgba(0, 0, 0, .55);
}

/* Aydınlık tema isteyen sayfalar için gövdeye data-se-light eklenir */
[data-se-light] {
  --se-surface: #FFFFFF;
  --se-surface-2: #F4F7F8;
  --se-surface-3: #E8EEF0;
  --se-border: rgba(10, 61, 74, .14);
  --se-ink: #12333D;
  --se-muted: #5C737B;
  --se-shadow: 0 22px 60px rgba(10, 61, 74, .24);
}

.se-hidden { display: none !important; }

/* ============================ Yüzen Buton (FAB) ============================ */
.se-fab {
  position: fixed; right: 18px; bottom: 18px; z-index: var(--se-z);
  width: 58px; height: 58px; border-radius: 50%; border: none; cursor: pointer;
  background: linear-gradient(135deg, var(--se-accent), var(--se-accent-2));
  color: #04211C; font-size: 1.4rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 12px 30px rgba(0, 212, 170, .35);
  transition: transform .2s ease, box-shadow .2s ease;
}
.se-fab:hover { transform: translateY(-3px) scale(1.05); box-shadow: 0 18px 40px rgba(0, 212, 170, .45); }
.se-fab:active { transform: scale(.95); }
.se-fab .se-fab-badge {
  position: absolute; top: -5px; right: -5px; min-width: 22px; height: 22px; padding: 0 5px;
  border-radius: 999px; background: var(--se-gold); color: #3A2A00; font-size: .68rem;
  font-weight: 900; display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--se-surface);
}
.se-fab.se-pulse { animation: se-pulse 2.4s infinite; }
@keyframes se-pulse {
  0%, 100% { box-shadow: 0 12px 30px rgba(0, 212, 170, .35); }
  50% { box-shadow: 0 0 0 14px rgba(0, 212, 170, .12); }
}

/* ============================ Arka Plan ============================ */
.se-backdrop {
  position: fixed; inset: 0; z-index: calc(var(--se-z) + 1);
  background: rgba(4, 12, 14, .5); backdrop-filter: blur(2px);
  opacity: 0; pointer-events: none; transition: opacity .25s ease;
}
.se-backdrop.se-open { opacity: 1; pointer-events: auto; }

/* ============================ Çekmece / Panel ============================ */
.se-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: calc(var(--se-z) + 2);
  width: min(400px, 94vw); background: var(--se-surface); color: var(--se-ink);
  border-left: 1px solid var(--se-border); box-shadow: var(--se-shadow);
  display: flex; flex-direction: column;
  transform: translateX(105%); transition: transform .3s cubic-bezier(.4, 0, .2, 1);
  font-family: "Plus Jakarta Sans", "Inter", system-ui, -apple-system, sans-serif;
}
.se-drawer.se-open { transform: translateX(0); }

.se-head {
  display: flex; align-items: center; gap: 10px; padding: 14px 16px;
  border-bottom: 1px solid var(--se-border); background: var(--se-surface-2);
}
.se-head-logo {
  width: 34px; height: 34px; border-radius: 10px; flex: 0 0 auto;
  background: linear-gradient(135deg, var(--se-accent), var(--se-accent-2));
  color: #04211C; font-weight: 900; display: flex; align-items: center;
  justify-content: center; font-size: 1rem;
}
.se-head-txt { flex: 1 1 auto; min-width: 0; }
.se-head-txt h3 { margin: 0; font-size: .98rem; font-weight: 800; letter-spacing: .2px; }
.se-head-txt p { margin: 2px 0 0; font-size: .72rem; color: var(--se-muted); }
.se-close {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px; cursor: pointer;
  border: 1px solid var(--se-border); background: var(--se-surface-3);
  color: var(--se-ink); font-size: 1.1rem; line-height: 1;
}
.se-close:hover { border-color: var(--se-accent); color: var(--se-accent); }

/* Sekmeler */
.se-tabs {
  display: flex; gap: 4px; padding: 8px; overflow-x: auto;
  border-bottom: 1px solid var(--se-border); background: var(--se-surface);
  scrollbar-width: thin;
}
.se-tab {
  flex: 0 0 auto; padding: 8px 12px; border-radius: 999px; cursor: pointer;
  border: 1px solid transparent; background: var(--se-surface-2); color: var(--se-muted);
  font-size: .76rem; font-weight: 700; white-space: nowrap; transition: all .18s ease;
}
.se-tab:hover { color: var(--se-ink); }
.se-tab.se-active {
  background: var(--se-accent-dim); color: var(--se-accent); border-color: var(--se-accent);
}

/* Gövde */
.se-body { flex: 1 1 auto; overflow-y: auto; padding: 14px; }
.se-body::-webkit-scrollbar { width: 9px; }
.se-body::-webkit-scrollbar-thumb { background: var(--se-surface-3); border-radius: 9px; }
.se-pane { display: none; animation: se-fade .25s ease; }
.se-pane.se-active { display: block; }
@keyframes se-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Genel alt başlık */
.se-sub {
  font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .6px;
  color: var(--se-muted); margin: 0 0 8px;
}

/* ============================ İlerleme ============================ */
.se-progress { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.se-progress-bar { flex: 1 1 auto; height: 8px; border-radius: 999px; background: var(--se-surface-3); overflow: hidden; }
.se-progress-fill { height: 100%; width: 0; background: linear-gradient(90deg, var(--se-accent), var(--se-gold)); transition: width .35s ease; }
.se-progress-txt { font-size: .72rem; font-weight: 800; color: var(--se-accent); white-space: nowrap; }

/* ============================ Rehber / Adımlar ============================ */
.se-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.se-step {
  display: flex; gap: 10px; align-items: flex-start; padding: 10px 12px;
  border-radius: 12px; background: var(--se-surface-2); border: 1px solid var(--se-border);
  cursor: pointer; transition: all .18s ease;
}
.se-step:hover { border-color: var(--se-accent); }
.se-step-no {
  flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%;
  background: var(--se-surface-3); color: var(--se-ink); font-weight: 900; font-size: .74rem;
  display: flex; align-items: center; justify-content: center;
}
.se-step-txt { flex: 1 1 auto; font-size: .82rem; line-height: 1.5; }
.se-step.se-done { border-color: var(--se-ok); background: rgba(53, 208, 127, .1); }
.se-step.se-done .se-step-no { background: var(--se-ok); color: #04210f; }
.se-step.se-done .se-step-txt { text-decoration: line-through; opacity: .8; }
.se-step.se-current { border-color: var(--se-accent); box-shadow: 0 0 0 3px var(--se-accent-dim); }
.se-step-hint { display: block; margin-top: 3px; font-size: .72rem; color: var(--se-muted); font-style: italic; }

/* ============================ Görevler ============================ */
.se-missions { display: flex; flex-direction: column; gap: 10px; }
.se-mission {
  padding: 12px; border-radius: 12px; background: var(--se-surface-2);
  border: 1px solid var(--se-border); transition: all .2s ease;
}
.se-mission.se-done { border-color: var(--se-ok); background: rgba(53, 208, 127, .08); }
.se-mission-head { display: flex; align-items: center; gap: 8px; }
.se-mission-check {
  width: 22px; height: 22px; border-radius: 6px; border: 2px solid var(--se-border);
  flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
  font-size: .8rem; color: transparent; background: var(--se-surface-3);
}
.se-mission.se-done .se-mission-check { background: var(--se-ok); border-color: var(--se-ok); color: #04210f; }
.se-mission-title { flex: 1 1 auto; font-size: .86rem; font-weight: 800; }
.se-badge {
  font-size: .64rem; font-weight: 900; padding: 3px 7px; border-radius: 999px;
  background: var(--se-accent-dim); color: var(--se-accent); text-transform: uppercase;
  letter-spacing: .4px;
}
.se-badge.se-b1 { background: rgba(53, 208, 127, .16); color: #35D07F; }
.se-badge.se-b2 { background: rgba(242, 183, 5, .16); color: #F2B705; }
.se-badge.se-b3 { background: rgba(255, 92, 92, .16); color: #FF7A7A; }
.se-mission-desc { margin: 8px 0 0; font-size: .78rem; line-height: 1.5; color: var(--se-muted); }
.se-mission-actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.se-mission-goal { margin-top: 8px; font-size: .74rem; color: var(--se-ink); }

/* Butonlar */
.se-btn {
  padding: 8px 12px; border-radius: 9px; cursor: pointer; font-size: .76rem; font-weight: 800;
  border: 1px solid var(--se-border); background: var(--se-surface-3); color: var(--se-ink);
  transition: all .16s ease;
}
.se-btn:hover { border-color: var(--se-accent); color: var(--se-accent); }
.se-btn.se-primary {
  background: linear-gradient(135deg, var(--se-accent), var(--se-accent-2));
  color: #04211C; border-color: transparent;
}
.se-btn.se-primary:hover { color: #04211C; filter: brightness(1.06); }
.se-btn.se-ghost { background: transparent; }
.se-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ============================ İpucu Kutuları ============================ */
.se-tip {
  display: flex; gap: 10px; padding: 11px 12px; border-radius: 12px; margin-bottom: 10px;
  border-left: 4px solid var(--se-accent); background: var(--se-surface-2); font-size: .8rem; line-height: 1.5;
}
.se-tip.se-warn { border-left-color: var(--se-gold); }
.se-tip.se-danger { border-left-color: var(--se-danger); }
.se-tip.se-ok { border-left-color: var(--se-ok); }
.se-tip-icon { flex: 0 0 auto; font-size: 1rem; }
.se-tip b { color: var(--se-ink); }
.se-empty { text-align: center; color: var(--se-muted); font-size: .8rem; padding: 22px 10px; }

/* ============================ Bileşen Bilgi Kartı ============================ */
.se-info-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.se-info-ico {
  width: 48px; height: 48px; border-radius: 12px; flex: 0 0 auto;
  background: var(--se-accent-dim); color: var(--se-accent); font-size: 1.3rem;
  display: flex; align-items: center; justify-content: center;
}
.se-info-head h4 { margin: 0; font-size: 1rem; }
.se-info-head p { margin: 3px 0 0; font-size: .74rem; color: var(--se-muted); }
.se-info-row { display: flex; gap: 8px; padding: 8px 0; border-top: 1px solid var(--se-border); font-size: .8rem; }
.se-info-row b { flex: 0 0 96px; color: var(--se-muted); font-weight: 700; }
.se-info-row span { flex: 1 1 auto; line-height: 1.5; }
.se-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.se-chip {
  font-size: .68rem; font-weight: 700; padding: 4px 8px; border-radius: 999px;
  background: var(--se-surface-3); color: var(--se-muted); border: 1px solid var(--se-border);
}

/* ============================ Galeri ============================ */
.se-filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.se-filter {
  font-size: .72rem; font-weight: 800; padding: 6px 11px; border-radius: 999px; cursor: pointer;
  background: var(--se-surface-2); color: var(--se-muted); border: 1px solid var(--se-border);
}
.se-filter.se-active { background: var(--se-accent); color: #04211C; border-color: var(--se-accent); }
.se-gallery { display: grid; grid-template-columns: 1fr; gap: 10px; }
.se-card {
  border-radius: 12px; background: var(--se-surface-2); border: 1px solid var(--se-border);
  padding: 12px; cursor: pointer; transition: all .18s ease;
}
.se-card:hover { transform: translateY(-2px); border-color: var(--se-accent); box-shadow: 0 10px 24px rgba(0, 0, 0, .3); }
.se-card-top { display: flex; align-items: flex-start; gap: 8px; }
.se-card-title { flex: 1 1 auto; font-size: .86rem; font-weight: 800; }
.se-stars { font-size: .74rem; color: var(--se-gold); white-space: nowrap; letter-spacing: 1px; }
.se-card-desc { margin: 7px 0 0; font-size: .76rem; color: var(--se-muted); line-height: 1.45; }
.se-card-foot { margin-top: 9px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.se-card-comp { font-size: .68rem; color: var(--se-muted); }
.se-load { font-size: .72rem; font-weight: 800; color: var(--se-accent); }

/* ============================ Kutlama ============================ */
.se-celebrate {
  position: fixed; inset: 0; z-index: calc(var(--se-z) + 5); display: none;
  align-items: center; justify-content: center; pointer-events: none;
}
.se-celebrate.se-show { display: flex; }
.se-celebrate-card {
  pointer-events: auto; text-align: center; padding: 26px 30px; border-radius: 20px;
  background: var(--se-surface); border: 1px solid var(--se-accent);
  box-shadow: 0 0 0 6px var(--se-accent-dim), var(--se-shadow);
  animation: se-pop .45s cubic-bezier(.2, 1.4, .4, 1);
  max-width: 82vw;
}
@keyframes se-pop { from { transform: scale(.7); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.se-celebrate-emoji { font-size: 2.6rem; }
.se-celebrate-card h3 { margin: 8px 0 4px; font-size: 1.1rem; color: var(--se-accent); }
.se-celebrate-card p { margin: 0 0 14px; font-size: .84rem; color: var(--se-muted); }
.se-confetti { position: fixed; top: -10px; width: 9px; height: 14px; z-index: calc(var(--se-z) + 4); pointer-events: none; animation: se-fall linear forwards; }
@keyframes se-fall { to { transform: translateY(105vh) rotate(720deg); opacity: .2; } }

/* ============================ Toast ============================ */
.se-toasts {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  z-index: calc(var(--se-z) + 6); display: flex; flex-direction: column; gap: 8px; align-items: center;
}
.se-toast {
  padding: 10px 16px; border-radius: 999px; font-size: .8rem; font-weight: 700;
  background: var(--se-surface); color: var(--se-ink); border: 1px solid var(--se-border);
  box-shadow: var(--se-shadow); animation: se-toast-in .25s ease;
}
.se-toast.se-ok { border-color: var(--se-ok); color: var(--se-ok); }
.se-toast.se-warn { border-color: var(--se-gold); color: var(--se-gold); }
.se-toast.se-danger { border-color: var(--se-danger); color: var(--se-danger); }
@keyframes se-toast-in { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ============================ Küçük ekran ============================ */
@media (max-width: 560px) {
  .se-drawer { width: 100vw; }
  .se-fab { width: 52px; height: 52px; }
}
