/*
 * Degerler Kesfi Yolculugu — durum ve marka stilleri.
 *
 * NEDEN DUZ CSS: yerlesim icin tw- utility kullanilir, ama DURUM (secili/kirpik/gecersiz) ve
 * MARKA renkleri buraya yazilir. Tailwind purge, sablonda gecmeyen sinif kombinasyonlarini
 * atabiliyor (bkz. CLAUDE.md gotcha: "bazi renkler inline style"); ayrica bu dosya anonim
 * public sayfada da yuklendigi icin Tailwind CDN'ine bagimli olmamasi gerekir.
 *
 * Tum kurallar #wtg-valuesjourney altina KAPSAMLIDIR — host sayfalara (documents sekmesi,
 * userwithoutcohort, public) sizmaz. Koseli parantezli arbitrary sinif KULLANILMAZ.
 */

#wtg-valuesjourney {
    --vj-primary: #223b40;
    --vj-accent: #ff7e33;
    --vj-accent-soft: #fff7ea;
    --vj-border: #e5e7eb;
    --vj-muted: #6b7280;
    --vj-danger: #b4453a;
    --vj-text: #374151;
}

/* ── Adim bolumleri ─────────────────────────────────────────────────────── */

#wtg-valuesjourney .vj-step {
    display: none;
}

#wtg-valuesjourney .vj-step.is-active {
    display: block;
}

/* Kademeli giris (referans framer-motion hissi): adim aktif olunca dogrudan cocuklar
   sirayla asagidan yukari belirir — "yazilar yavas yavas gelir". */
@keyframes vj-rise {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: none; }
}

/* fill-mode "both": from-durumu (opacity:0) gecis oncesi/sirasinda uygulanir, to-durumu
   (opacity:1) sonra tutulur. Base'te opacity:0 YOK — animasyon hic calismasa (eski tarayici,
   gizli sekmede baslayip "bitmis" sayilan animasyon) bile icerik gorunur kalir. */
#wtg-valuesjourney .vj-step.is-active > * {
    animation: vj-rise 0.5s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#wtg-valuesjourney .vj-step.is-active > *:nth-child(1) { animation-delay: 0.04s; }
#wtg-valuesjourney .vj-step.is-active > *:nth-child(2) { animation-delay: 0.14s; }
#wtg-valuesjourney .vj-step.is-active > *:nth-child(3) { animation-delay: 0.24s; }
#wtg-valuesjourney .vj-step.is-active > *:nth-child(4) { animation-delay: 0.34s; }
#wtg-valuesjourney .vj-step.is-active > *:nth-child(5) { animation-delay: 0.44s; }
#wtg-valuesjourney .vj-step.is-active > *:nth-child(n+6) { animation-delay: 0.54s; }

/* Rehberlik metni paragraflari da kendi icinde birer birer akar (meditasyon hissi). */
#wtg-valuesjourney .vj-step.is-active .vj-guidance-p {
    animation: vj-rise 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
#wtg-valuesjourney .vj-step.is-active .vj-guidance-p:nth-child(1) { animation-delay: 0.30s; }
#wtg-valuesjourney .vj-step.is-active .vj-guidance-p:nth-child(2) { animation-delay: 0.42s; }
#wtg-valuesjourney .vj-step.is-active .vj-guidance-p:nth-child(3) { animation-delay: 0.54s; }
#wtg-valuesjourney .vj-step.is-active .vj-guidance-p:nth-child(4) { animation-delay: 0.66s; }
#wtg-valuesjourney .vj-step.is-active .vj-guidance-p:nth-child(5) { animation-delay: 0.78s; }
#wtg-valuesjourney .vj-step.is-active .vj-guidance-p:nth-child(6) { animation-delay: 0.90s; }
#wtg-valuesjourney .vj-step.is-active .vj-guidance-p:nth-child(7) { animation-delay: 1.02s; }
#wtg-valuesjourney .vj-step.is-active .vj-guidance-p:nth-child(n+8) { animation-delay: 1.14s; }

/* ── Kart ve baslik ─────────────────────────────────────────────────────── */

#wtg-valuesjourney .vj-card {
    background: #fff;
    border: 1px solid var(--vj-border);
    border-radius: 16px;
    padding: 20px;
}

#wtg-valuesjourney .vj-title {
    color: var(--vj-primary);
    font-weight: 700;
    line-height: 1.25;
}

#wtg-valuesjourney .vj-desc {
    color: var(--vj-muted);
    line-height: 1.6;
}

/* Rehberlik metni (Nefes / Gorsellestirme meditasyon paragraflari). */
#wtg-valuesjourney .vj-guidance-p {
    color: var(--vj-text);
    line-height: 1.75;
    font-size: 1rem;
    margin: 0 0 1rem 0;
}

#wtg-valuesjourney .vj-guidance-p:last-child {
    margin-bottom: 0;
}

/* Bilgi kutusu — marka imzasi locked_tab.mustache:54 ile ayni (accent zemin + sol serit). */
#wtg-valuesjourney .vj-info {
    background: var(--vj-accent-soft);
    border: 1px solid var(--vj-border);
    border-left: 4px solid var(--vj-accent);
    border-radius: 8px;
    padding: 16px 20px;
    color: #374151;
    line-height: 1.6;
}

#wtg-valuesjourney .vj-icon-badge {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--vj-accent-soft);
    color: var(--vj-accent);
    flex: none;
}

/* ── Form alanlari ──────────────────────────────────────────────────────── */

#wtg-valuesjourney .vj-field {
    width: 100%;
    box-sizing: border-box;
    padding: 11px 13px;
    border: 1px solid #d3d8da;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.5;
    outline: none;
    background: #fff;
    color: #111827;
}

#wtg-valuesjourney textarea.vj-field {
    min-height: 96px;
    resize: vertical;
}

#wtg-valuesjourney .vj-field:focus {
    border-color: var(--vj-accent);
    box-shadow: 0 0 0 3px rgba(255, 126, 51, 0.18);
}

#wtg-valuesjourney .vj-field.is-invalid {
    border-color: var(--vj-danger);
    box-shadow: 0 0 0 3px rgba(180, 69, 58, 0.14);
}

#wtg-valuesjourney .vj-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #4b5854;
    margin-bottom: 6px;
}

/* ── Butonlar ───────────────────────────────────────────────────────────── */

#wtg-valuesjourney .vj-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    border: 1px solid transparent;
    text-decoration: none;
    transition: transform 0.15s ease, background-color 0.15s ease;
}

#wtg-valuesjourney .vj-btn:hover {
    transform: translateY(-1px);
}

#wtg-valuesjourney .vj-btn-primary {
    background: var(--vj-primary);
    color: #fff;
}

#wtg-valuesjourney .vj-btn-accent {
    background: var(--vj-accent);
    color: #fff;
}

#wtg-valuesjourney .vj-btn-ghost {
    background: transparent;
    color: var(--vj-primary);
    border-color: #d3d8da;
}

#wtg-valuesjourney .vj-btn-danger-text {
    background: transparent;
    color: var(--vj-danger);
    border-color: transparent;
    font-weight: 600;
}

/* ── Ilerleme cubugu ────────────────────────────────────────────────────── */

#wtg-valuesjourney .vj-progress-track {
    height: 6px;
    border-radius: 999px;
    background: #eceff1;
    overflow: hidden;
}

#wtg-valuesjourney .vj-progress-fill {
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: var(--vj-accent);
    transition: width 0.35s ease;
}

#wtg-valuesjourney .vj-dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: #d7dde0;
    border: none;
    padding: 0;
    cursor: default;
}

#wtg-valuesjourney .vj-dot.is-visited {
    background: var(--vj-primary);
    cursor: pointer;
}

#wtg-valuesjourney .vj-dot.is-current {
    background: var(--vj-accent);
    box-shadow: 0 0 0 3px rgba(255, 126, 51, 0.22);
    cursor: default;
}

/* ── Deger secim gridi ──────────────────────────────────────────────────── */

#wtg-valuesjourney .vj-value {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 10px;
    border: 2px solid var(--vj-border);
    border-radius: 12px;
    background: #fff;
    cursor: pointer;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    transition: border-color 0.15s ease, background-color 0.15s ease, opacity 0.15s ease;
}

#wtg-valuesjourney .vj-value:hover {
    border-color: #c9d1d4;
}

#wtg-valuesjourney .vj-value .vj-value-icon {
    color: var(--vj-muted);
}

#wtg-valuesjourney .vj-value.is-selected {
    border-color: var(--vj-accent);
    background: var(--vj-accent-soft);
    color: var(--vj-primary);
}

#wtg-valuesjourney .vj-value.is-selected .vj-value-icon {
    color: var(--vj-accent);
}

/*
 * Limit dolunca secilmeyen kartlar SOLUKLASIR ama TIKLANABILIR kalir (disabled DEGIL):
 * disabled buton click olayi uretmez, o zaman kullaniciya "once birini kaldir" toast'ini
 * gosteremeyiz ve ekran okuyucu neden ilerlenemedigini kaybeder.
 */
#wtg-valuesjourney .vj-value.is-dim {
    opacity: 0.45;
}

#wtg-valuesjourney .vj-value-check {
    position: absolute;
    top: 6px;
    right: 6px;
    color: var(--vj-accent);
}

#wtg-valuesjourney .vj-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 999px;
    background: var(--vj-accent-soft);
    color: var(--vj-primary);
    font-size: 13px;
    font-weight: 600;
}

/* ── Zirve anilari (referans: acilir ozet kartlar + tek taslak form) ─────── */

#wtg-valuesjourney .vj-memory-index {
    font-size: 13px;
    font-weight: 700;
    color: var(--vj-accent);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* Eklenmis ani — acilir ozet kart. */
#wtg-valuesjourney .vj-mem-card {
    border: 1px solid var(--vj-border);
    border-radius: 14px;
    background: #fafbfb;
    margin-bottom: 12px;
    overflow: hidden;
    animation: vj-rise 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

#wtg-valuesjourney .vj-mem-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    width: 100%;
    padding: 14px 16px;
    background: transparent;
    border: 0;
    cursor: pointer;
    text-align: left;
}

#wtg-valuesjourney .vj-mem-left {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0;
}

#wtg-valuesjourney .vj-mem-num {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: var(--vj-accent-soft);
    color: var(--vj-accent);
    font-size: 13px;
    font-weight: 700;
}

#wtg-valuesjourney .vj-mem-title {
    font-weight: 600;
    color: var(--vj-primary);
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#wtg-valuesjourney .vj-mem-sub {
    font-size: 13px;
    color: var(--vj-muted);
    margin: 2px 0 0 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

#wtg-valuesjourney .vj-mem-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

#wtg-valuesjourney .vj-mem-check {
    color: var(--vj-accent);
    display: inline-flex;
}

#wtg-valuesjourney .vj-mem-chev {
    color: var(--vj-muted);
    display: inline-flex;
    transition: transform 0.2s ease;
}

#wtg-valuesjourney .vj-mem-card.is-open .vj-mem-chev {
    transform: rotate(180deg);
}

#wtg-valuesjourney .vj-mem-body {
    padding: 0 16px 16px 60px;
    border-top: 1px solid var(--vj-border);
    margin-top: 2px;
    padding-top: 12px;
}

#wtg-valuesjourney .vj-mem-row {
    font-size: 14px;
    color: var(--vj-primary);
    margin: 0 0 4px 0;
}

#wtg-valuesjourney .vj-mem-row-k {
    color: var(--vj-muted);
}

/* Aktif taslak form. */
#wtg-valuesjourney .vj-mem-form {
    border: 1px solid var(--vj-border);
    border-radius: 16px;
    padding: 20px;
    background: #fff;
    margin-bottom: 12px;
}

#wtg-valuesjourney .vj-add-memory {
    width: 100%;
    padding: 14px;
    border: 0;
    border-radius: 12px;
    background: var(--vj-accent);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    transition: filter 0.15s ease, opacity 0.15s ease;
}

#wtg-valuesjourney .vj-add-memory:hover {
    filter: brightness(0.95);
}

#wtg-valuesjourney .vj-add-memory.is-disabled {
    opacity: 0.5;
    cursor: not-allowed;
    filter: none;
}

/* ── Sesli rehberlik oynaticisi ─────────────────────────────────────────── */

#wtg-valuesjourney .vj-audio-card {
    background: #fff;
    border: 1px solid var(--vj-border);
    border-radius: 16px;
    padding: 14px 16px;
}

#wtg-valuesjourney .vj-audio-row {
    display: flex;
    align-items: center;
    gap: 14px;
}

#wtg-valuesjourney .vj-audio-btn {
    width: 46px;
    height: 46px;
    border: 0;
    border-radius: 999px;
    background: var(--vj-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, transform 0.1s ease;
}

#wtg-valuesjourney .vj-audio-btn:hover {
    transform: scale(1.05);
}

#wtg-valuesjourney .vj-audio-btn.is-playing {
    background: var(--vj-accent);
}

#wtg-valuesjourney .vj-audio-ic {
    width: 22px;
    height: 22px;
    /* Play ucgeni optik olarak saga kaysin (dolu ucgen sola yaslidir). */
    margin-left: 1px;
}

#wtg-valuesjourney .vj-audio-btn.is-playing .vj-audio-ic {
    margin-left: 0;
}

#wtg-valuesjourney .vj-audio-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--vj-primary);
}

#wtg-valuesjourney .vj-audio-time {
    font-size: 12px;
    color: var(--vj-muted);
}

/* Seek slider — marka renginde. */
#wtg-valuesjourney .vj-audio-seek {
    accent-color: var(--vj-accent);
    cursor: pointer;
}

/* Ekolayzer — yalnizca calarken gorunur; her cubuk gecikmeli zipla.
   NOT: ID-kapsamli kural tw-hidden'i (tek class) ozgullukte ezer; bu yuzden gizleme
   burada dogrudan tanimlanir (:not(.tw-hidden) ile), toggle JS'te tw-hidden ile yapilir. */
#wtg-valuesjourney .vj-eq {
    display: none;
    align-items: flex-end;
    gap: 3px;
    height: 16px;
    margin: 10px 0 0 60px;
}

#wtg-valuesjourney .vj-eq:not(.tw-hidden) {
    display: flex;
}

#wtg-valuesjourney .vj-eq span {
    width: 3px;
    height: 4px;
    border-radius: 2px;
    background: var(--vj-accent);
    animation: vj-eq 0.9s ease-in-out infinite;
}

#wtg-valuesjourney .vj-eq span:nth-child(1) { animation-delay: 0s; }
#wtg-valuesjourney .vj-eq span:nth-child(2) { animation-delay: 0.15s; }
#wtg-valuesjourney .vj-eq span:nth-child(3) { animation-delay: 0.30s; }
#wtg-valuesjourney .vj-eq span:nth-child(4) { animation-delay: 0.45s; }
#wtg-valuesjourney .vj-eq span:nth-child(5) { animation-delay: 0.60s; }

@keyframes vj-eq {
    0%, 100% { height: 4px; }
    50%      { height: 16px; }
}

/* ── Kaydetme durumu ────────────────────────────────────────────────────── */

#wtg-valuesjourney .vj-save-state {
    font-size: 12px;
    color: var(--vj-muted);
    min-height: 16px;
}

/* ── Erisilebilirlik ────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
    /* Giris/reveal animasyonlari kapatilir; icerik dogrudan gorunur. NOT: ekolayzer (.vj-eq
       span) BILINCLI olarak HARIC — kucuk, tekrarli "ses caliyor" gostergesidir; kullanici
       acikca hareketli olmasini istedi. Rahatsiz edici bir hareket degil. */
    #wtg-valuesjourney .vj-step.is-active > *,
    #wtg-valuesjourney .vj-step.is-active .vj-guidance-p,
    #wtg-valuesjourney .vj-mem-card {
        animation: none;
        opacity: 1;
    }
    #wtg-valuesjourney .vj-btn:hover,
    #wtg-valuesjourney .vj-audio-btn:hover { transform: none; }
    #wtg-valuesjourney .vj-progress-fill { transition: none; }
}

/*
 * Anonim public sayfada Font Awesome YUKLU DEGILDIR (o sayfada $OUTPUT->header() cagrilmaz
 * ve tek stylesheet linki olan theme/remui/style/moodle.css diskte yok). toaster.js ikonlari
 * <i class="fas fa-*"> uretir; asagidaki kurallar onlari bos kutu yerine metin sembolle
 * gosterir. Yalnizca <body class="wtg-public-page"> olan sayfalarda devreye girer.
 */
body.wtg-public-page .toast i.fas::before {
    font-family: inherit;
    font-style: normal;
    font-weight: 700;
}

body.wtg-public-page .toast i.fa-check::before { content: "\2713"; }
body.wtg-public-page .toast i.fa-times::before { content: "\2715"; }
body.wtg-public-page .toast i.fa-exclamation-triangle::before { content: "\26A0"; }
body.wtg-public-page .toast i.fa-info-circle::before { content: "\2139"; }
