/* ==========================================================================
   LikedWin — Anasayfa Bildirim & Güncelleme paneli
   site.css değişkenlerini kullanır (--brand, --ink, --muted, --line ...).
   Aydınlık/premium tema. Masaüstü: zil altında dropdown · Mobil: üstten sheet.
   ========================================================================== */

/* hidden özniteliği explicit display'i ezemediği için garanti altına al.
   NOT: panel/backdrop 'display:flex' + 'position:fixed' olduğundan, kapalıyken
   (hidden) ekranı görünmez şekilde kaplayıp tüm tıklamaları yutuyordu — özellikle
   mobilde header'ı erişilemez kılıyordu. Bu yüzden ikisi de listeye dahil. */
.lw-notif-panel[hidden],
.lw-notif-backdrop[hidden],
.lw-notif-badge[hidden],
.lw-notif-tab__count[hidden],
.lw-notif-tab__dot[hidden],
.lw-notif-clear[hidden],
.lw-upd-react__n[hidden],
.lw-upd-list[hidden],
.lw-upd-detail[hidden] { display: none !important; }

/* ---- Zil rozeti (masaüstü head-icon-btn + mobil) ---- */
.lw-notif-bell { position: relative; }
.lw-notif-badge {
    position: absolute; top: -4px; right: -4px;
    min-width: 17px; height: 17px; padding: 0 4px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 999px;
    background: #ef4444; color: #fff;
    font-size: 10px; font-weight: 800; line-height: 1;
    border: 2px solid var(--surface);
    box-shadow: 0 2px 6px -1px rgba(239, 68, 68, .5);
}
.lw-notif-bell.has-unread i { animation: lwBellSwing 2.4s ease-in-out infinite; transform-origin: 50% 12%; }
@keyframes lwBellSwing {
    0%, 82%, 100% { transform: rotate(0); }
    86% { transform: rotate(11deg); } 90% { transform: rotate(-8deg); }
    94% { transform: rotate(5deg); }  98% { transform: rotate(-2deg); }
}

/* Mobil zil (headbar'da, mobile-login yanında) */
.mobile-notif {
    position: relative;
    display: none; align-items: center; justify-content: center;
    width: 40px; height: 40px; margin-right: 4px;
    border: 1px solid var(--line); border-radius: 11px;
    background: var(--surface); color: var(--ink); font-size: 16px;
    -webkit-tap-highlight-color: transparent;
}
.mobile-notif:hover { border-color: var(--brand-line); color: var(--brand); }

/* ---- Arka perde ---- */
.lw-notif-backdrop {
    position: fixed; inset: 0; z-index: 1190;
    background: rgba(16, 24, 40, .28);
    opacity: 0; transition: opacity .2s ease;
    -webkit-backdrop-filter: blur(1px); backdrop-filter: blur(1px);
}
.lw-notif-backdrop.is-open { opacity: 1; }

/* ---- Panel ---- */
.lw-notif-panel {
    position: fixed; z-index: 1200;
    top: 90px; right: 24px;
    width: 384px; max-width: calc(100vw - 24px);
    max-height: min(72vh, 640px);
    display: flex; flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 18px;
    box-shadow: 0 24px 60px -18px rgba(16, 24, 40, .32), 0 4px 14px -8px rgba(16, 24, 40, .2);
    overflow: hidden;
    transform: translateY(-8px) scale(.98);
    opacity: 0; transform-origin: top right;
    transition: opacity .2s ease, transform .2s cubic-bezier(.22, .61, .36, 1);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
}
.lw-notif-panel.is-open { opacity: 1; transform: translateY(0) scale(1); }

/* ---- Panel başlık: sekmeler + aksiyonlar ---- */
.lw-notif-panel__head {
    display: flex; align-items: center; gap: 8px;
    padding: 10px 10px 0;
    border-bottom: 1px solid var(--line);
}
.lw-notif-tabs { position: relative; display: flex; flex: 1 1 auto; gap: 2px; }
.lw-notif-tab {
    position: relative; z-index: 1;
    display: inline-flex; align-items: center; gap: 7px;
    padding: 10px 12px 14px;
    background: none; border: 0;
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-size: 14px; font-weight: 700; letter-spacing: -.01em;
    color: var(--muted); cursor: pointer; transition: color .18s ease;
}
.lw-notif-tab:hover { color: var(--ink); }
.lw-notif-tab.is-active { color: var(--brand); }
.lw-notif-tab__count {
    min-width: 18px; height: 18px; padding: 0 5px;
    display: inline-flex; align-items: center; justify-content: center;
    border-radius: 999px; background: var(--brand-soft); color: var(--brand);
    font-size: 11px; font-weight: 800;
}
.lw-notif-tab.is-active .lw-notif-tab__count { background: var(--brand); color: #fff; }
.lw-notif-tab__dot {
    width: 8px; height: 8px; border-radius: 50%;
    background: #ef4444; box-shadow: 0 0 0 3px rgba(239, 68, 68, .16);
}
.lw-notif-tab__ind {
    position: absolute; left: 0; bottom: 0; z-index: 2;
    width: 0; height: 2.5px; border-radius: 3px;
    background: linear-gradient(90deg, var(--brand), #4f7bff);
    transition: transform .26s cubic-bezier(.4, 0, .2, 1);
}
.lw-notif-clear, .lw-notif-close {
    flex: 0 0 auto;
    width: 34px; height: 34px; margin-bottom: 6px;
    display: inline-grid; place-items: center;
    border: 1px solid var(--line); border-radius: 10px;
    background: var(--surface); color: var(--muted); font-size: 14px; cursor: pointer;
    transition: all .16s ease;
}
.lw-notif-clear:hover { color: #ef4444; border-color: #fecaca; background: var(--err-bg); }
.lw-notif-close:hover { color: var(--ink); border-color: var(--brand-line); }

/* ---- Görünümler ---- */
.lw-notif-views { position: relative; flex: 1 1 auto; overflow: hidden; display: flex; }
.lw-notif-view { display: none; flex: 1 1 auto; min-height: 0; overflow-y: auto; }
.lw-notif-view.is-active { display: block; }
.lw-notif-view::-webkit-scrollbar { width: 8px; }
.lw-notif-view::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 8px; border: 2px solid var(--surface); }

/* ---- Bildirim öğesi ---- */
.lw-notif-list { padding: 8px; display: flex; flex-direction: column; gap: 6px; }
.lw-notif-item {
    position: relative;
    display: grid; grid-template-columns: 40px 1fr auto; gap: 11px; align-items: start;
    padding: 12px; border-radius: 13px;
    background: var(--surface); border: 1px solid var(--line);
    transition: background .16s ease, border-color .16s ease, transform .2s ease, opacity .2s ease;
}
.lw-notif-item.is-link { cursor: pointer; }
.lw-notif-item.is-link:hover { border-color: var(--brand-line); background: #fafbff; }
.lw-notif-item.is-unread { background: #f6f8ff; border-color: var(--brand-line); }
.lw-notif-item.is-unread::before {
    content: ''; position: absolute; left: 5px; top: 50%; transform: translateY(-50%);
    width: 6px; height: 6px; border-radius: 50%; background: var(--brand);
}
.lw-notif-item.is-removing { opacity: 0; transform: translateX(14px); }
.lw-notif-item__icon {
    width: 40px; height: 40px; border-radius: 11px;
    display: grid; place-items: center; color: #fff; font-size: 15px;
    background: var(--c, var(--brand));
    box-shadow: 0 6px 14px -6px var(--c, var(--brand));
}
.lw-notif-item__body { min-width: 0; }
.lw-notif-item__title { font-size: 13.5px; font-weight: 800; color: var(--ink); line-height: 1.3; margin-bottom: 2px; }
.lw-notif-item__msg {
    font-size: 12.5px; color: var(--muted); line-height: 1.45;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.lw-notif-item__time { margin-top: 6px; font-size: 11px; color: var(--muted-2); font-weight: 600; }
.lw-notif-item__time i { font-size: 10px; margin-right: 3px; }
.lw-notif-item__x {
    width: 24px; height: 24px; border: 0; border-radius: 7px;
    background: transparent; color: var(--muted-2); font-size: 12px; cursor: pointer;
    display: grid; place-items: center; transition: all .15s ease;
}
.lw-notif-item__x:hover { background: var(--err-bg); color: #ef4444; }

/* ---- Güncelleme kartı ---- */
.lw-upd-list { padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.lw-upd-card {
    position: relative; display: flex; flex-direction: column;
    border-radius: 14px; cursor: pointer; overflow: hidden;
    background: var(--surface); border: 1px solid var(--line);
    transition: border-color .16s ease, box-shadow .18s ease, transform .18s ease;
}
.lw-upd-card:hover { border-color: var(--brand-line); box-shadow: 0 10px 22px -14px rgba(16, 24, 40, .3); transform: translateY(-1px); }
.lw-upd-card.is-unread { border-color: var(--brand-line); }
.lw-upd-card.is-unread::after {
    content: ''; position: absolute; top: 10px; right: 10px; z-index: 2;
    width: 9px; height: 9px; border-radius: 50%; background: var(--brand);
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px rgba(37, 68, 216, .18);
}
/* Tam genişlik kapak görsel (kart üstünde) */
.lw-upd-card__cover { width: 100%; height: 150px; background: var(--brand-soft); overflow: hidden; }
.lw-upd-card__cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lw-upd-card__body { min-width: 0; padding: 11px 13px 12px; }
.lw-upd-card__title {
    font-size: 13.5px; font-weight: 800; color: var(--ink); line-height: 1.3;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.lw-upd-card__sum {
    font-size: 12px; color: var(--muted); line-height: 1.4; margin-top: 2px;
    display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.lw-upd-card__meta { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.lw-upd-card__time { font-size: 11px; color: var(--muted-2); font-weight: 600; }
.lw-upd-card__time i { font-size: 10px; margin-right: 3px; }
.lw-upd-card__react { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 1px; }
.lw-upd-card__react b { margin-left: 3px; color: var(--muted); font-weight: 700; }

/* ---- Güncelleme detayı ---- */
.lw-upd-detail { padding: 12px 14px 16px; }
.lw-upd-detail__back {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 6px 10px; margin-bottom: 12px;
    border: 1px solid var(--line); border-radius: 9px; background: var(--surface);
    font-size: 12.5px; font-weight: 700; color: var(--muted); cursor: pointer; transition: all .15s ease;
}
.lw-upd-detail__back:hover { color: var(--brand); border-color: var(--brand-line); }
.lw-upd-detail__img { border-radius: 13px; overflow: hidden; margin-bottom: 12px; background: var(--brand-soft); }
.lw-upd-detail__img img { width: 100%; height: auto; display: block; }
.lw-upd-detail__title {
    font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
    font-size: 18px; font-weight: 800; line-height: 1.25; letter-spacing: -.01em;
    color: var(--ink); margin: 0 0 6px;
}
.lw-upd-detail__time { font-size: 11.5px; color: var(--muted-2); font-weight: 600; margin-bottom: 12px; }
.lw-upd-detail__time i { margin-right: 3px; }
.lw-upd-detail__content { font-size: 13.5px; line-height: 1.65; color: var(--text); }
.lw-upd-detail__content p { margin: 0 0 10px; }
.lw-upd-detail__content a { color: var(--brand); font-weight: 600; text-decoration: underline; }
.lw-upd-detail__content ul, .lw-upd-detail__content ol { margin: 0 0 10px; padding-left: 20px; }
.lw-upd-detail__content h3, .lw-upd-detail__content h4 { font-family: 'Plus Jakarta Sans', sans-serif; margin: 14px 0 6px; color: var(--ink); }
.lw-upd-detail__content img { max-width: 100%; height: auto; border-radius: 10px; }
.lw-upd-detail__link {
    display: inline-flex; align-items: center; gap: 7px; margin-top: 12px;
    padding: 9px 15px; border-radius: 10px;
    background: var(--brand-soft); color: var(--brand);
    font-size: 13px; font-weight: 700; transition: background .16s ease;
}
.lw-upd-detail__link:hover { background: var(--brand-soft-2, #e2e8fb); }

/* ---- Emoji reaksiyon barı ---- */
.lw-upd-react {
    display: flex; flex-wrap: wrap; gap: 14px; margin-top: 16px;
    padding-top: 14px; border-top: 1px dashed var(--line);
}
.lw-upd-react__btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 2px; border: 0; background: none; cursor: pointer;
    transition: transform .14s ease;
}
.lw-upd-react__btn:hover { transform: translateY(-2px); }
.lw-upd-react__emo { font-size: 21px; line-height: 1; transition: transform .14s ease; }
.lw-upd-react__n { font-size: 12px; font-weight: 800; color: var(--muted); min-width: 8px; }
.lw-upd-react__btn.is-mine .lw-upd-react__emo { transform: scale(1.22); }
.lw-upd-react__btn.is-mine .lw-upd-react__n { color: var(--brand); }

/* ---- Boş / yükleniyor ---- */
.lw-notif-empty { padding: 46px 24px; text-align: center; color: var(--muted-2); }
.lw-notif-empty i { font-size: 30px; color: var(--brand-line); margin-bottom: 12px; display: block; }
.lw-notif-empty p { margin: 0 0 4px; font-size: 14px; font-weight: 700; color: var(--muted); }
.lw-notif-empty span { font-size: 12.5px; }
.lw-notif-loading { padding: 40px 20px; text-align: center; color: var(--muted); font-size: 13px; }
.lw-notif-loading i { color: var(--brand); margin-right: 6px; }

/* ---- Mobil: zil tetikleyici görünür (site kırılımı 900px) ---- */
@media (max-width: 900px) {
    /* NOT: .mobile-actions'ın display/gap'i site.css'te yönetiliyor; burada
       tekrar tanımlanınca (bu dosya site.css'ten SONRA yükleniyor) oradaki
       boşluk ayarı eziliyordu. */
    .mobile-notif { display: inline-flex; }
}
/* ---- Küçük ekran: panel üstten sheet ---- */
@media (max-width: 600px) {
    .lw-notif-panel {
        top: 10px; left: 10px; right: 10px; bottom: auto;
        width: auto; max-width: none; max-height: 88vh;
        transform-origin: top center; border-radius: 16px;
    }
}

/* ---- Erişilebilirlik: hareket azalt ---- */
@media (prefers-reduced-motion: reduce) {
    .lw-notif-panel, .lw-notif-backdrop, .lw-notif-tab__ind, .lw-notif-item, .lw-upd-card, .lw-upd-react__btn { transition: none; }
    .lw-notif-bell.has-unread i { animation: none; }
}
