/* Secrez Toast Notification System */
/* Replaces native alert() with modern, non-blocking feedback */

.secrez-toast-container {
    position: fixed;
    top: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
    padding: 0 16px;
    max-width: 100%;
    box-sizing: border-box;
}

[dir="rtl"] .secrez-toast-container {
    left: 16px;
    right: auto;
}

[dir="ltr"] .secrez-toast-container {
    right: 16px;
    left: auto;
}

@media (max-width: 480px) {
    .secrez-toast-container {
        top: 12px;
        padding: 0 12px;
        left: 12px !important;
        right: 12px !important;
    }
}

.secrez-toast {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: var(--radius-md, 12px);
    background: var(--bg-glass);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-accent);
    box-shadow: var(--shadow-card);
    font-family: var(--font-fa, 'Vazirmatn', 'Inter', sans-serif);
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.5;
    color: var(--text-primary);
    pointer-events: auto;
    cursor: default;
    max-width: 400px;
    animation: toastSlideIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.secrez-toast.hiding {
    animation: toastSlideOut 0.25s ease forwards;
}

.secrez-toast .toast-icon {
    flex-shrink: 0;
    font-size: 1.25rem;
}

.secrez-toast .toast-message {
    flex: 1;
}

.secrez-toast .toast-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.secrez-toast .toast-action-btn {
    display: inline-flex;
    align-items: center;
    padding: 6px 12px;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s, opacity 0.2s;
}

.secrez-toast .toast-action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    color: inherit;
}

.secrez-toast .toast-close {
    flex-shrink: 0;
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px;
    font-size: 1rem;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.secrez-toast .toast-close:hover {
    opacity: 1;
}

/* Toast Variants */
.secrez-toast.toast-success {
    border-color: rgba(var(--accent-success-rgb), 0.4);
    background: rgba(var(--accent-success-rgb), 0.12);
}

.secrez-toast.toast-success .toast-icon {
    color: var(--accent-success);
}

.secrez-toast.toast-error {
    border-color: rgba(var(--accent-danger-rgb), 0.4);
    background: rgba(var(--accent-danger-rgb), 0.12);
}

.secrez-toast.toast-error .toast-icon {
    color: var(--accent-danger);
}

.secrez-toast.toast-warning {
    border-color: rgba(var(--accent-warning-rgb), 0.4);
    background: rgba(var(--accent-warning-rgb), 0.12);
}

.secrez-toast.toast-warning .toast-icon {
    color: var(--accent-warning);
}

.secrez-toast.toast-info {
    border-color: rgba(var(--accent-info-rgb), 0.4);
    background: rgba(var(--accent-info-rgb), 0.12);
}

.secrez-toast.toast-info .toast-icon {
    color: var(--accent-info);
}

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

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

/* Notification Bell (Phase 2) */
.secrez-notification-bell-wrap {
    position: fixed;
    top: 16px;
    z-index: 1000; /* Lower than theme toggle (1001) so theme toggle stays on top */
    /* Offset from theme toggle button - RTL: left side, LTR: right side */
}
[dir="rtl"] .secrez-notification-bell-wrap { 
    left: 64px; /* After theme toggle in RTL */
    right: auto; 
}
[dir="rtl"] .secrez-notification-badge { 
    right: auto; 
    left: -4px; 
}
[dir="ltr"] .secrez-notification-bell-wrap { 
    right: 64px; /* After theme toggle in LTR */
    left: auto; 
}

.secrez-notification-bell {
    position: relative;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--bg-glass, rgba(255,255,255,0.1));
    border: 1px solid var(--border-accent, rgba(255,255,255,0.2));
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.secrez-notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 18px;
    height: 18px;
    background: #ef4444;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

.secrez-notification-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    margin-top: 8px;
    width: 280px;
    max-height: 320px;
    overflow-y: auto;
    background: var(--bg-secondary, #1e293b);
    border: 1px solid var(--border-accent);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    padding: 8px 0;
}
.secrez-notification-dropdown.open { display: block; }
[dir="rtl"] .secrez-notification-dropdown { left: 0; right: auto; }
[dir="ltr"] .secrez-notification-dropdown { right: 0; left: auto; }

.secrez-notif-item, .secrez-notif-all {
    display: block;
    padding: 10px 16px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 0.9rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.secrez-notif-item:hover, .secrez-notif-all:hover {
    background: rgba(255,255,255,0.08);
}
.secrez-notif-item.unread { font-weight: 600; }
.secrez-notif-empty { padding: 20px; text-align: center; color: var(--text-secondary); }
.secrez-notif-all { text-align: center; font-weight: 600; border-bottom: none; }
