﻿/* === Tetikleyici alan ve rozet === */
.notification-area {
    position: relative;
    margin-right: 20px;
}

.notification-icon, #notification-icon {
    position: relative;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 999px;
    transition: background .18s ease;
    font-size: 20px;
    color: #333;
}

    .notification-icon:hover, #notification-icon:hover {
        background: rgba(0,0,0,.04);
        color: #1976d2;
    }

.big-icon {
    font-size: 18px;
}



@keyframes badge-pulse {
    0%,100% {
        transform: scale(1)
    }

    50% {
        transform: scale(1.1)
    }
}

/* === Panel (açılır kutu) === */
.notification-panel {
    position: absolute;
    top: 52px;
    right: 0;
    width: 520px;
    max-width: calc(100vw - 24px);
    background: #fff;
    border: 1px solid rgba(0,0,0,.06);
    border-radius: 14px;
    box-shadow: 0 12px 30px rgba(0,0,0,.12);
    overflow: hidden;
    display: none;
    z-index: 1000;
    animation: notif-pop .18s ease-out;
}

@keyframes notif-pop {
    from {
        transform: translateY(-6px);
        opacity: 0
    }

    to {
        transform: translateY(0);
        opacity: 1
    }
}

/* === Başlık / toolbar === */
.notification-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(0,0,0,.06);
    background: linear-gradient(180deg, rgba(0,0,0,.02), rgba(0,0,0,0));
}

    .notification-header h3 {
        margin: 0;
        font-size: 16px;
        font-weight: 700;
    }

.notification-actions {
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.notification-close {
    border: none;
    background: transparent;
    padding: 6px;
    border-radius: 8px;
    cursor: pointer;
    transition: background .18s ease, transform .08s ease;
}

    .notification-close:hover {
        background: rgba(0,0,0,.06);
    }

    .notification-close:active {
        transform: scale(.98);
    }

/* DevExtreme butonları panel içinde kompakt */
.notification-actions .dx-button {
    --pad: 6px 10px;
}

    .notification-actions .dx-button .dx-button-content {
        padding: var(--pad);
    }

/* === Liste === */
#notificationList {
    max-height: 480px;
    overflow: auto;
}

/* Kart benzeri satır */
.notification-item {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px 10px;
    padding: 12px 14px;
    border-bottom: 1px solid rgba(0,0,0,.04);
    transition: background .12s ease, box-shadow .12s ease;
    cursor: pointer;
}

    .notification-item:hover {
        background: rgba(0,0,0,.02);
    }

    .notification-item.unread {
        background: rgba(30,136,229,.05);
    }

    .notification-item.read {
        opacity: .95;
    }

/* Tür etiketi + küçük renk noktası */
.notification-type {
    grid-column: 1 / -1;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    margin-bottom: 2px;
}

    .notification-type.info::before,
    .notification-type.warning::before,
    .notification-type.error::before {
        content: "";
        width: 10px;
        height: 10px;
        border-radius: 50%;
        display: inline-block;
    }

    .notification-type.info::before {
        background: #1e88e5;
    }

    .notification-type.warning::before {
        background: #fb8c00;
    }

    .notification-type.error::before {
        background: #e53935;
    }

/* İçerik ve meta bilgiler */
.notification-message {
    grid-column: 1 / 2;
    font-size: 13.5px;
    line-height: 1.35;
    color: #333;
}

.notification-meta {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    font-size: 12px;
    opacity: .75;
}

.notification-source {
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid rgba(0,0,0,.08);
    background: rgba(0,0,0,.03);
}

.notification-time {
    margin-left: auto;
    white-space: nowrap;
}

/* === Toast bar (mevcut showToast için) === */
.notification-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    padding: 12px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 9999;
    animation: slideDown .3s ease-out;
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
}

    .notification-bar.info {
        background: #e3f2fd;
        color: #1976d2;
        border-bottom: 1px solid #bbdefb;
    }

    .notification-bar.warning {
        background: #fff3e0;
        color: #f57c00;
        border-bottom: 1px solid #ffe0b2;
    }

    .notification-bar.error {
        background: #ffebee;
        color: #d32f2f;
        border-bottom: 1px solid #ffcdd2;
    }

.notification-content {
    flex: 1;
    margin-right: 16px;
}

.notification-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.notification-close {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    opacity: .7;
}

    .notification-close:hover {
        opacity: 1;
    }

@keyframes slideDown {
    from {
        transform: translateY(-100%)
    }

    to {
        transform: translateY(0)
    }
}

/* === Hata detayları (buton + içerik) === */
.notification-toggle-details {
    grid-column: 1 / -1;
    display: inline-block;
    margin-top: 6px;
    align-self: start;
    background: transparent;
    border: 1px solid rgba(0,0,0,.12);
    border-radius: 8px;
    padding: 6px 10px;
    font-size: 12px;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease, transform .05s ease;
}

    .notification-toggle-details:hover {
        background: rgba(0,0,0,.05);
        border-color: rgba(0,0,0,.25);
    }

    .notification-toggle-details:active {
        transform: scale(.97);
    }

.notification-details {
    grid-column: 1 / -1;
    margin-top: 8px;
    padding: 10px;
    background: rgba(0,0,0,.03);
    border: 1px dashed rgba(0,0,0,.15);
    border-radius: 8px;
    font-size: 12px;
    line-height: 1.4;
}

.stacktrace-content {
    margin: 0;
    white-space: pre-wrap;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

/* === Küçük ekranlar === */
@media (max-width:480px) {
    .notification-panel {
        width: calc(100vw - 12px);
        right: 6px;
    }

    .notification-item {
        grid-template-columns: 1fr;
    }

    .notification-time {
        margin-left: 0;
    }
}
/* === TAG'leri aynı satıra al === */
.notification-item {
    /* 1) Tür  2) Etiket+zaman (esnek)  3) Zaman için yer */
    grid-template-columns: auto 1fr auto;
    align-items: center;
}

/* Tür etiketi solda, tek kolonda kalsın */
.notification-type {
    grid-column: 1; /* override: önceki 1 / -1 yerine */
    margin-bottom: 0; /* satır içi hizaya uygun */
}

/* Kaynak etiketi + zaman aynı satırda */
.notification-meta {
    grid-column: 2 / -1; /* türün yanında */
    grid-row: 1; /* ilk satır */
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 0; /* override: önceki margin-top */
    opacity: .9; /* okunabilirlik için hafif artır */
}

/* Kaynak küçük bir chip olarak kalsın */
.notification-source {
    padding: 2px 8px;
    border-radius: 999px;
    border: 1px solid rgba(0,0,0,.08);
    background: rgba(0,0,0,.03);
}

/* Zaman sağa yaslansın */
.notification-time {
    margin-left: auto; /* meta satırında en sağa gider */
    white-space: nowrap;
}

/* Mesaj ikinci satıra insin, tam genişlik */
.notification-message {
    grid-row: 2;
    grid-column: 1 / -1;
    margin-top: 6px;
}

/* Küçük ekran: tekrar dikey istif */
@media (max-width: 480px) {
    .notification-item {
        grid-template-columns: 1fr;
    }

    .notification-type {
        grid-column: 1;
    }

    .notification-meta {
        grid-column: 1 / -1;
        grid-row: auto;
        margin-top: 6px;
    }

    .notification-time {
        margin-left: 0;
    }
}
/* Panel taşmasın: başlık sabit, içerik kaydırılabilir */
.notification-panel {
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    overscroll-behavior: contain;
}

/* dxList kapsayıcısı panel içinde esnesin ve scroll olsun */
#notificationList {
    flex: 1 1 auto;
    min-height: 0; /* flex overflow için kritik */
    overflow: auto;
    height: auto !important; /* varsa sabit height'ı bastır */
}

/* Mesaj ve stacktrace satır kırma */
.notification-message,
.stacktrace-content {
    white-space: pre-wrap; /* \n koru, satır kır */
    overflow-wrap: anywhere; /* çok uzun kelimeleri kır */
    word-break: break-word;
}

/* Detay kutusu panel dışına taşmasın */
.notification-details {
    max-height: 240px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
}
/* Mesajı 2 satırla sınırla (ellipsis etkisi) */
.notification-message {
    /* clamp */
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    /* satır kırma */
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    
}

/* Detaylar açıkken clamp'ı kesin kaldır (yüksek özgüllük + !important) */
#notificationList .notification-item.expanded .notification-message {
    display: block !important;
    -webkit-line-clamp: initial !important; /* bazı bundlerlarda 'unset' çalışmıyor */
    line-clamp: initial !important;
    max-height: none !important;
    overflow: visible !important;
    mask-image: none !important;
}
/* Detaylar açıkken kırpmayı kaldır */
.notification-item.expanded .notification-message {
    -webkit-line-clamp: unset;
    display: block;
}

/* Detay kutusu panel içinde kaydırılabilir kalsın */
.notification-details {
    max-height: 240px;
    overflow: auto;
}


/* Detay kutusu zaten scroll'lu ve panel içinde kalıyor */
.notification-details {
    max-height: 240px;
    overflow: auto;
}

/* Varsayılan: 2 satır kısalt */
.notification-message {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* Detaylar açıkken kısaltmayı kaldır (yüksek özgüllük + !important) */
#notificationList .notification-item.expanded .notification-message,
#notificationList .notification-message.expanded {
    display: block !important;
    -webkit-line-clamp: initial !important;
    overflow: visible !important;
    max-height: none !important;
    mask-image: none !important;
}

/* Detay kutusu panel içinde scroll */
.notification-details {
    max-height: 240px;
    overflow: auto;
}

/* Zil rozetini köşeye sabitle, boyutu sabit tut, sayıyı ortala */
#notification-badge {
    position: absolute;
    
    right: 2px;
    transform: translate(45%, -45%); /* köşeye taşı */
    min-width: 14px; /* 2 hane */
    height: 14px;
    padding: 0 4px; /* 3 hane olursa uzasın */
    box-sizing: border-box;
    display: none; /* JS > inline-flex yapacak */
    align-items: center;
    justify-content: center;
    background: #e53935;
    color: #fff;
    border-radius: 999px;
    box-shadow: 0 0 0 2px rgba(0,0,0,.03);
    font-size: 9px; /* daha zarif */
    line-height: 14px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    font-feature-settings: "tnum"; /* rakamlar eşit genişlikte */
}

/* Zil hover rengi kalsın, ama rozet zilden taşmasın */
#notification-icon {
    position: relative;
    width: 36px;
    height: 36px;
}
/* Bildirimler başlığındaki "Temizle" butonu – modern/pill */
.notification-actions .dx-button.dx-button-danger {
    background: #e53935; /* soft-danger */
    border: 1px solid #d32f2f;
    color: #fff;
    padding-left: 2px;
    padding-right: 4px;
    border-radius: 999px; /* pill */
    box-shadow: 0 2px 6px rgba(0,0,0,.06);
    transition: background .15s ease, border-color .15s ease, box-shadow .15s ease, transform .05s ease;
    align-items: center;
}

    /* İçerik hizası ve kompakt yükseklik */
    .notification-actions .dx-button.dx-button-danger .dx-button-content {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        height: 36px; 
        min-height: 34px;
        padding: 6px 12px; /* ~30-32px yükseklik */
        font-weight: 600;
        letter-spacing: .1px;
        line-height: 1;
    }
    .notification-actions .dx-button.dx-button-danger .dx-icon {
        font-size: 16px;
        line-height: 1;
        transform: translateY(-0.5px); /* 1px mikro dengeleme */
    }

    .notification-actions .dx-button.dx-button-danger .dx-button-text {
        line-height: 1;
        display: inline-block;
    }
    /* Çöp kutusu ikonunu biraz küçült */
    .notification-actions .dx-button.dx-button-danger .dx-icon-trash {
        font-size: 16px;
        line-height: 1;
    }

    /* Hover / Active / Focus halleri */
    .notification-actions .dx-button.dx-button-danger:hover {
        background: #d32f2f;
        border-color: #c62828;
        box-shadow: 0 4px 12px rgba(211,47,47,.20);
        
    }

    .notification-actions .dx-button.dx-button-danger:active {
        transform: translateY(1px);
        box-shadow: 0 1px 2px rgba(0,0,0,.12) inset;
    }

    .notification-actions .dx-button.dx-button-danger:focus-visible {
        outline: none;
        box-shadow: 0 0 0 3px rgba(229,57,53,.22);
    }

    /* DevExtreme disabled durumu */
    .notification-actions .dx-button.dx-button-danger.dx-state-disabled {
        opacity: .6;
        pointer-events: none;
    }

/* İstersen “daha sakin” bir varyant: outline görünüm (opsiyonel)
   HTML'e ekstra sınıf eklemeye gerek yok; istersen .notif-outline sınıfı ekleyip kullanabilirsin. */
.notification-actions .dx-button.notif-outline {
    background: transparent;
    color: #d32f2f;
    border: 1px solid #ef9a9a;
}

    .notification-actions .dx-button.notif-outline:hover {
        background: #fff5f5;
        border-color: #ef5350;
    }

