/* ============================================================
   ChatPulse - Toast Notifications
   ============================================================ */

.toast-container {
    position: fixed !important;
    top: max(16px, env(safe-area-inset-top, 16px)) !important;
    right: max(16px, env(safe-area-inset-right, 16px)) !important;
    z-index: 9999999 !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    pointer-events: none !important;
    max-width: min(420px, calc(100vw - 32px)) !important;
}

.toast {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    min-width: 290px;
    max-width: 400px;
    padding: 12px 16px;
    background: rgba(20, 20, 36, 0.96) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    border: 1px solid rgba(255, 255, 255, 0.14) !important;
    border-radius: 14px !important;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.65), 0 0 1px rgba(255, 255, 255, 0.2) !important;
    pointer-events: auto !important;
    animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.toast.hiding {
    animation: fadeOut 0.3s ease forwards;
}

.toast.toast-clickable {
    cursor: pointer;
    transition: all var(--transition-fast);
}

.toast.toast-clickable:hover {
    transform: translateY(-2px);
    border-color: var(--accent-primary) !important;
    box-shadow: 0 16px 45px rgba(108, 92, 231, 0.45), 0 0 12px var(--accent-primary-light) !important;
}

.toast-icon {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-full);
    flex-shrink: 0;
    font-size: var(--font-md);
}

.toast.success .toast-icon { background: var(--success-light); color: var(--success); }
.toast.error .toast-icon { background: var(--danger-light); color: var(--danger); }
.toast.warning .toast-icon { background: var(--warning-light); color: var(--warning); }
.toast.info .toast-icon { background: var(--info-light); color: var(--info); }

.toast-content {
    flex: 1;
}

.toast-title {
    font-size: var(--font-sm);
    font-weight: var(--font-weight-semibold);
    color: var(--text-primary);
}

.toast-message {
    font-size: var(--font-xs);
    color: var(--text-tertiary);
    margin-top: 2px;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-tertiary);
    cursor: pointer;
    padding: 4px;
    font-size: var(--font-md);
    transition: color var(--transition-fast);
}

.toast-close:hover {
    color: var(--text-primary);
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--accent-gradient);
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
    transition: width linear;
}

/* ============================================================
   Desktop Notification Prompt Floating Banner
   ============================================================ */
.desktop-notif-prompt-banner {
    position: fixed;
    bottom: max(20px, env(safe-area-inset-bottom, 20px));
    right: max(20px, env(safe-area-inset-right, 20px));
    z-index: 999998;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: rgba(18, 18, 30, 0.94);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(108, 92, 231, 0.35);
    border-radius: 16px;
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.6), 0 0 25px rgba(108, 92, 231, 0.2);
    max-width: 440px;
    width: calc(100vw - 40px);
    animation: slideUpFadeIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.notif-prompt-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, #6c5ce7, #a29bfe);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.4);
}

.notif-prompt-body {
    flex: 1;
    min-width: 0;
}

.notif-prompt-title {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-prompt-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.35;
}

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

.notif-prompt-btn {
    padding: 7px 14px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

.notif-prompt-btn-primary {
    background: #6c5ce7;
    color: #fff;
    box-shadow: 0 4px 12px rgba(108, 92, 231, 0.35);
}

.notif-prompt-btn-primary:hover {
    background: #5b4bc4;
    transform: translateY(-1px);
}

.notif-prompt-btn-ghost {
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
}

.notif-prompt-btn-ghost:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

/* Strictly hide desktop notification prompt banner on all mobile devices */
@media (max-width: 850px) {
    .desktop-notif-prompt-banner {
        display: none !important;
    }
}

/* ============================================================
   SyiChat - PWA Mobile Install Bottom Sheet Modal
   Strictly mobile-only, native aesthetic, luxury glassmorphism
   ============================================================ */
.pwa-install-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    z-index: 999998;
    pointer-events: none;
    font-family: inherit;
}

.pwa-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    pointer-events: auto;
    animation: pwaFadeIn 0.25s ease forwards;
}

.pwa-sheet {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 100vw;
    box-sizing: border-box;
    z-index: 999999;
    pointer-events: auto;
    background: rgba(16, 16, 26, 0.98);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid rgba(108, 92, 231, 0.35);
    border-radius: 22px 22px 0 0;
    padding: 12px 18px max(24px, calc(16px + env(safe-area-inset-bottom, 16px))) 18px;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.8), 0 0 25px rgba(108, 92, 231, 0.2);
    animation: pwaSlideUp 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.pwa-install-overlay.closing .pwa-backdrop {
    animation: pwaFadeOut 0.25s ease forwards;
}

.pwa-install-overlay.closing .pwa-sheet {
    animation: pwaSlideDown 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes pwaFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes pwaFadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes pwaSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@keyframes pwaSlideDown {
    from { transform: translateY(0); }
    to { transform: translateY(100%); }
}

.pwa-sheet-handle {
    width: 36px;
    height: 4px;
    background: rgba(255, 255, 255, 0.22);
    border-radius: 4px;
    margin: 0 auto 12px auto;
}

.pwa-sheet-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.pwa-app-icon-wrap {
    position: relative;
    width: 48px;
    height: 48px;
    min-width: 48px;
    max-width: 48px;
    flex-shrink: 0;
}

.pwa-app-icon {
    width: 48px;
    height: 48px;
    min-width: 48px;
    max-width: 48px;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(108, 92, 231, 0.35);
    object-fit: cover;
    display: block;
}

.pwa-sheet-meta {
    flex: 1;
    min-width: 0;
}

.pwa-app-title {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 2px 0;
    letter-spacing: -0.2px;
}

.pwa-app-subtitle {
    font-size: 12.5px;
    color: rgba(255, 255, 255, 0.65);
    margin: 0;
    line-height: 1.3;
}

.pwa-features-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 20px;
}

.pwa-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(108, 92, 231, 0.15);
    border: 1px solid rgba(108, 92, 231, 0.3);
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
    color: #d1c4e9;
}

.pwa-install-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pwa-btn {
    width: 100%;
    padding: 13px 20px;
    border-radius: 14px;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    -webkit-tap-highlight-color: transparent;
}

.pwa-btn-primary {
    background: linear-gradient(135deg, #6c5ce7 0%, #8e44ad 100%);
    color: #fff;
    box-shadow: 0 8px 25px rgba(108, 92, 231, 0.45);
}

.pwa-btn-primary:active {
    transform: scale(0.98);
    box-shadow: 0 4px 15px rgba(108, 92, 231, 0.35);
}

.pwa-btn-ghost {
    background: rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.65);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.pwa-btn-ghost:active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

/* iOS Specific Guide */
.pwa-ios-guide {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 18px;
}

.pwa-ios-guide-title {
    font-size: 13px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0 10px 0;
}

.pwa-ios-step {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 8px;
}

.pwa-ios-step:last-child {
    margin-bottom: 0;
}

.pwa-step-num {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #6c5ce7;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pwa-ios-icon {
    color: #00cec9;
    flex-shrink: 0;
    margin-left: auto;
}

/* Strict Desktop Protection: Never ever display on PC */
@media (min-width: 851px) {
    .pwa-install-overlay {
        display: none !important;
    }
}


