/**
 * Firebase Notifications - Toast & Prompt Styling
 * Premium glassmorphism design with animations
 */

/* ========================================
   Toast Container
   ======================================== */
.fcm-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 380px;
    width: calc(100% - 40px);
}

/* ========================================
   Toast Notification
   ======================================== */
.fcm-toast {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    background: linear-gradient(145deg, rgba(26, 26, 46, 0.98), rgba(22, 33, 62, 0.98));
    border-radius: 16px;
    border: 1px solid rgba(201, 162, 39, 0.3);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    cursor: pointer;
    transform: translateX(120%);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fcm-toast.show {
    transform: translateX(0);
    opacity: 1;
}

.fcm-toast:hover {
    transform: translateX(-5px);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(201, 162, 39, 0.4) inset;
}

/* Toast Icon */
.fcm-toast-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(135deg, #c9a227, #8b6914);
    display: flex;
    align-items: center;
    justify-content: center;
}

.fcm-toast-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Toast Content */
.fcm-toast-content {
    flex: 1;
    min-width: 0;
}

.fcm-toast-title {
    font-size: 1rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 4px;
    line-height: 1.3;
}

.fcm-toast-body {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

/* Toast Close Button */
.fcm-toast-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.fcm-toast-close:hover {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    transform: rotate(90deg);
}

/* Toast Type Colors */
.fcm-toast-new_order {
    border-color: rgba(34, 197, 94, 0.5);
}

.fcm-toast-new_order .fcm-toast-icon {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

.fcm-toast-order_status_change {
    border-color: rgba(59, 130, 246, 0.5);
}

.fcm-toast-order_status_change .fcm-toast-icon {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.fcm-toast-new_contact {
    border-color: rgba(168, 85, 247, 0.5);
}

.fcm-toast-new_contact .fcm-toast-icon {
    background: linear-gradient(135deg, #a855f7, #9333ea);
}

.fcm-toast-order_cancelled {
    border-color: rgba(239, 68, 68, 0.5);
}

.fcm-toast-order_cancelled .fcm-toast-icon {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.fcm-toast-new_user {
    border-color: rgba(236, 72, 153, 0.5);
}

.fcm-toast-new_user .fcm-toast-icon {
    background: linear-gradient(135deg, #ec4899, #db2777);
}

/* ========================================
   Permission Prompt
   ======================================== */
.fcm-permission-prompt {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    z-index: 99999;
    opacity: 0;
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.fcm-permission-prompt.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.fcm-permission-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 24px;
    background: linear-gradient(145deg, rgba(26, 26, 46, 0.98), rgba(22, 33, 62, 0.98));
    border-radius: 20px;
    border: 1px solid rgba(201, 162, 39, 0.3);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.5),
        0 0 0 1px rgba(255, 255, 255, 0.05) inset;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    max-width: 420px;
    width: calc(100vw - 48px);
}

.fcm-permission-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    background: linear-gradient(135deg, #c9a227, #a78419);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: white;
    flex-shrink: 0;
    animation: bellRing 2s ease-in-out infinite;
}

@keyframes bellRing {
    0%, 100% { transform: rotate(0); }
    10%, 30% { transform: rotate(15deg); }
    20%, 40% { transform: rotate(-15deg); }
    50%, 100% { transform: rotate(0); }
}

.fcm-permission-text {
    flex: 1;
    min-width: 0;
}

.fcm-permission-text strong {
    display: block;
    color: #ffffff;
    font-size: 1.05rem;
    margin-bottom: 4px;
}

.fcm-permission-text p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.85rem;
    margin: 0;
    line-height: 1.4;
}

.fcm-permission-actions {
    display: flex;
    gap: 10px;
    flex-shrink: 0;
}

.fcm-btn-allow,
.fcm-btn-later {
    padding: 10px 18px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.fcm-btn-allow {
    background: linear-gradient(135deg, #c9a227, #a78419);
    color: #1a1a2e;
}

.fcm-btn-allow:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(201, 162, 39, 0.3);
}

.fcm-btn-later {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}

.fcm-btn-later:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
}

/* ========================================
   Responsive
   ======================================== */
@media (max-width: 480px) {
    .fcm-toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        width: auto;
        max-width: none;
    }

    .fcm-toast {
        padding: 14px;
        gap: 12px;
    }

    .fcm-toast-icon {
        width: 42px;
        height: 42px;
    }

    .fcm-toast-title {
        font-size: 0.95rem;
    }

    .fcm-toast-body {
        font-size: 0.85rem;
    }

    .fcm-permission-card {
        flex-direction: column;
        text-align: center;
        padding: 24px 20px;
    }

    .fcm-permission-actions {
        width: 100%;
    }

    .fcm-btn-allow,
    .fcm-btn-later {
        flex: 1;
    }
}

/* Light mode adjustments */
[data-bs-theme="light"] .fcm-toast,
[data-bs-theme="light"] .fcm-permission-card {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.98), rgba(249, 250, 251, 0.98));
    border-color: rgba(201, 162, 39, 0.3);
}

[data-bs-theme="light"] .fcm-toast-title,
[data-bs-theme="light"] .fcm-permission-text strong {
    color: #1a1a2e;
}

[data-bs-theme="light"] .fcm-toast-body,
[data-bs-theme="light"] .fcm-permission-text p {
    color: rgba(26, 26, 46, 0.7);
}

[data-bs-theme="light"] .fcm-toast-close {
    background: rgba(0, 0, 0, 0.05);
    color: rgba(0, 0, 0, 0.4);
}

[data-bs-theme="light"] .fcm-toast-close:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #1a1a2e;
}

[data-bs-theme="light"] .fcm-btn-later {
    background: rgba(0, 0, 0, 0.05);
    color: rgba(0, 0, 0, 0.6);
}

[data-bs-theme="light"] .fcm-btn-later:hover {
    background: rgba(0, 0, 0, 0.1);
    color: #1a1a2e;
}
