/* ─── Inline notifikacije ───────────────────────────────────────────── */
.header-right {
    position: relative;
}

.notification-bell {
    position: relative;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary, #94a3b8);
    padding: 6px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 180ms ease, color 180ms ease;
}

.notification-bell:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text, #f8fafc);
}

.notification-bell.active {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text, #f8fafc);
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: var(--red, #ef4444);
    color: #fff;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.35);
}

.notification-badge.hidden {
    display: none;
}

.notification-center {
    position: fixed;
    top: 16px;
    right: 16px;
    width: 360px;
    max-width: calc(100vw - 32px);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

.notification {
    pointer-events: auto;
    background: var(--card, rgba(255, 255, 255, 0.08));
    border: 1px solid var(--border, rgba(255, 255, 255, 0.15));
    border-radius: var(--radius, 14px);
    padding: 14px 16px;
    box-shadow: var(--shadow-lg, 0 12px 40px rgba(15, 23, 42, 0.12));
    font-size: 0.95rem;
    line-height: 1.45;
    color: var(--text, #f8fafc);
    animation: notifySlideIn 220ms ease;
    position: relative;
    overflow: hidden;
}

/* Confirm/prompt notifikacije imaju čvrstu pozadinu da tekst bude čitljiv */
.notification--confirm,
.notification--prompt {
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.35);
}

.notification--confirm .notification-input,
.notification--prompt .notification-input {
    background: var(--bg, #0a0a0f);
    color: var(--text, #f8fafc);
}

@keyframes notifySlideIn {
    from { opacity: 0; transform: translateX(20px); }
    to   { opacity: 1; transform: translateX(0); }
}

.notification--info    { border-left: 4px solid var(--primary, #2563eb); }
.notification--success { border-left: 4px solid var(--green, #10b981); }
.notification--warning { border-left: 4px solid var(--orange, #f59e0b); }
.notification--error   { border-left: 4px solid var(--red, #ef4444); }

.notification-message {
    margin-bottom: 10px;
    padding-right: 18px;
}

.notification-input-wrap {
    margin-bottom: 10px;
}

.notification-input {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid var(--border, rgba(255, 255, 255, 0.15));
    border-radius: var(--radius-sm, 10px);
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 180ms ease, box-shadow 180ms ease;
}

.notification-input:focus {
    border-color: var(--primary, #2563eb);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.notification-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
}

.notification-btn {
    padding: 7px 14px;
    border-radius: var(--radius-sm, 10px);
    border: none;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 180ms ease, transform 180ms ease;
}

.notification-btn:hover {
    transform: translateY(-1px);
}

.notification-btn--primary {
    background: var(--primary, #2563eb);
    color: #fff;
}

.notification-btn--primary:hover {
    background: var(--primary-dark, #1d4ed8);
}

.notification--error .notification-btn--primary,
.notification--warning .notification-btn--primary {
    background: var(--red, #ef4444);
}

.notification--error .notification-btn--primary:hover,
.notification--warning .notification-btn--primary:hover {
    background: #dc2626;
}

.notification-btn--secondary {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text, #f8fafc);
}

.notification-btn--secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.notification-close {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    font-size: 1.2rem;
    line-height: 1;
    color: var(--text-secondary, #94a3b8);
    cursor: pointer;
    border-radius: 6px;
    transition: background 180ms ease, color 180ms ease;
}

.notification-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text, #f8fafc);
}

/* ─── Povijest notifikacija (zvono) ─────────────────────────────────── */
.notification-history-panel {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    width: 360px;
    max-width: calc(100vw - 32px);
    background: rgba(15, 23, 42, 0.96);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border, rgba(255, 255, 255, 0.15));
    border-radius: var(--radius, 14px);
    box-shadow: var(--shadow-lg, 0 12px 40px rgba(15, 23, 42, 0.12));
    z-index: 200;
    display: flex;
    flex-direction: column;
    max-height: 70vh;
    overflow: hidden;
    animation: notifyDropdownIn 180ms ease;
}

@keyframes notifyDropdownIn {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

.notification-history-panel.hidden {
    display: none;
}

.notification-history-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.15));
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-weight: 700;
    font-size: 0.98rem;
    color: var(--text, #f8fafc);
}

.notification-history-close {
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: none;
    font-size: 1.3rem;
    line-height: 1;
    color: var(--text-secondary, #94a3b8);
    cursor: pointer;
    border-radius: 6px;
    transition: background 180ms ease, color 180ms ease;
}

.notification-history-close:hover {
    background: rgba(255, 255, 255, 0.08);
    color: var(--text, #f8fafc);
}

.notification-history-list {
    flex: 1;
    overflow-y: auto;
    max-height: 50vh;
    padding: 6px 0;
}

.notification-history-empty {
    padding: 28px 16px;
    text-align: center;
    color: var(--text-secondary, #94a3b8);
    font-size: 0.92rem;
}

.notification-history-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border, rgba(255, 255, 255, 0.15));
    font-size: 0.9rem;
    color: var(--text, #f8fafc);
    line-height: 1.4;
    transition: background 180ms ease;
}

.notification-history-item:last-child {
    border-bottom: none;
}

.notification-history-item:hover {
    background: rgba(255, 255, 255, 0.06);
}

.notification-history-item--unread {
    background: rgba(14, 165, 233, 0.12);
}

.notification-history-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-top: 5px;
    flex-shrink: 0;
}

.notification-history-dot--info    { background: var(--primary, #2563eb); }
.notification-history-dot--success { background: var(--green, #10b981); }
.notification-history-dot--warning { background: var(--orange, #f59e0b); }
.notification-history-dot--error   { background: var(--red, #ef4444); }

.notification-history-body {
    flex: 1;
    min-width: 0;
}

.notification-history-time {
    display: block;
    font-size: 0.75rem;
    color: var(--text-secondary, #94a3b8);
    margin-top: 3px;
}

.notification-history-footer {
    padding: 10px 14px;
    border-top: 1px solid var(--border, rgba(255, 255, 255, 0.15));
    display: flex;
    justify-content: flex-end;
}

.notification-history-clear {
    padding: 6px 12px;
    border-radius: var(--radius-sm, 10px);
    border: none;
    background: rgba(255, 255, 255, 0.08);
    color: var(--text, #f8fafc);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: background 180ms ease;
}

.notification-history-clear:hover {
    background: rgba(255, 255, 255, 0.1);
}

@media (max-width: 600px) {
    .notification-center {
        top: 10px;
        right: 10px;
        left: 10px;
        width: auto;
    }

    .notification-history-panel {
        right: 10px;
        left: 10px;
        width: auto;
    }
}

/* ─── Svetla tema ──────────────────────────────────────────────────── */
[data-theme="light"] .notification-bell:hover {
    background: #f1f5f9;
    color: var(--text);
}

[data-theme="light"] .notification-bell.active {
    background: #e2e8f0;
    color: var(--text);
}

[data-theme="light"] .notification-input {
    background: var(--bg);
    color: var(--text);
}

[data-theme="light"] .notification-btn--secondary {
    background: #f1f5f9;
    color: var(--text);
}

[data-theme="light"] .notification-btn--secondary:hover {
    background: #e2e8f0;
}

[data-theme="light"] .notification-close:hover {
    background: #f1f5f9;
    color: var(--text);
}

[data-theme="light"] .notification-history-item:hover {
    background: var(--bg);
}

[data-theme="light"] .notification-history-item--unread {
    background: rgba(37, 99, 235, 0.06);
}

[data-theme="light"] .notification-history-clear {
    background: #f1f5f9;
    color: var(--text);
}

[data-theme="light"] .notification-history-clear:hover {
    background: #e2e8f0;
}

[data-theme="light"] .notification-history-panel {
    background: #ffffff;
    border-color: var(--border);
}

[data-theme="light"] .notification--confirm,
[data-theme="light"] .notification--prompt {
    background: var(--card);
    border-color: var(--border);
    box-shadow: var(--shadow-lg);
}

[data-theme="light"] .notification--confirm .notification-input,
[data-theme="light"] .notification--prompt .notification-input {
    background: var(--bg);
    color: var(--text);
}
