/* ==========================================================================
   Bitspark Global - Toast Notifications & Voice Alert System
   ========================================================================== */

#global-toast-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 999999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    width: calc(100% - 48px);
    pointer-events: none;
}

.global-toast {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px 20px;
    border-radius: 12px;
    background: #FFFFFF;
    color: #161616;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.12), 0 5px 15px rgba(0, 0, 0, 0.06);
    border-left: 5px solid #161616;
    transform: translateX(120%);
    opacity: 0;
    transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
    position: relative;
    overflow: hidden;
    font-family: var(--default-font, "Cal Sans", sans-serif);
}

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

.global-toast.toast-hide {
    transform: translateX(120%);
    opacity: 0;
}

/* Toast Variants */
.global-toast.toast-success {
    border-left-color: #10B981;
}
.global-toast.toast-success .toast-icon {
    background: rgba(16, 185, 129, 0.15);
    color: #10B981;
}

.global-toast.toast-error,
.global-toast.toast-danger {
    border-left-color: #EF4444;
}
.global-toast.toast-error .toast-icon,
.global-toast.toast-danger .toast-icon {
    background: rgba(239, 68, 68, 0.15);
    color: #EF4444;
}

.global-toast.toast-warning {
    border-left-color: #F59E0B;
}
.global-toast.toast-warning .toast-icon {
    background: rgba(245, 158, 11, 0.15);
    color: #F59E0B;
}

.global-toast.toast-info {
    border-left-color: #3B82F6;
}
.global-toast.toast-info .toast-icon {
    background: rgba(59, 130, 246, 0.15);
    color: #3B82F6;
}

/* Toast Elements */
.toast-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-size: 15px;
    font-weight: 700;
    color: #161616;
    margin-bottom: 3px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.toast-message {
    font-size: 13.5px;
    color: #555555;
    line-height: 1.45em;
    margin: 0;
}

.toast-voice-badge {
    font-size: 11px;
    color: var(--accent-color, #EF4823);
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-top: 4px;
    opacity: 0.85;
}

.toast-voice-badge.speaking i {
    animation: voicePulse 1s infinite;
}

@keyframes voicePulse {
    0% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); opacity: 0.7; }
}

.toast-close-btn {
    background: none;
    border: none;
    color: #999999;
    font-size: 14px;
    cursor: pointer;
    padding: 2px 4px;
    margin-left: 8px;
    transition: color 0.2s ease;
    align-self: flex-start;
}

.toast-close-btn:hover {
    color: #161616;
}

/* Toast Progress Bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    width: 100%;
    background: rgba(0, 0, 0, 0.06);
}

.toast-progress-fill {
    height: 100%;
    width: 100%;
    background: var(--accent-color, #EF4823);
    transition: width linear;
}

.toast-success .toast-progress-fill { background: #10B981; }
.toast-error .toast-progress-fill,
.toast-danger .toast-progress-fill { background: #EF4444; }
.toast-warning .toast-progress-fill { background: #F59E0B; }
.toast-info .toast-progress-fill { background: #3B82F6; }

/* Voice Toggle Widget on Navbar/Screen */
.tts-voice-toggle {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 9999;
    background: #161616;
    color: #FFFFFF;
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 30px;
    padding: 8px 14px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
}

.tts-voice-toggle:hover {
    background: var(--accent-color, #EF4823);
    color: #FFFFFF;
}

.tts-voice-toggle.voice-muted {
    opacity: 0.6;
    background: #444444;
}

@media (max-width: 575px) {
    #global-toast-container {
        top: 15px;
        right: 15px;
        left: 15px;
        width: calc(100% - 30px);
        max-width: 100%;
    }
}
