/**
 * Streamzy Cloud Toast Notification Styles
 * Aligned with current UI design (Dark Theme)
 */

/* Toast Container */
#toast-container {
    z-index: 9999;
}

/* Base Toast Styling */
.streamzy-toast {
    min-width: 320px;
    max-width: 420px;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4),
                0 2px 8px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    margin-bottom: 12px;
    border: none;
    animation: slideInRight 0.3s ease-out;
    font-family: 'Graphie', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.streamzy-toast.showing {
    opacity: 1;
}

.streamzy-toast:not(.show) {
    opacity: 0;
}

/* Toast Header */
.streamzy-toast .toast-header {
    padding: 12px 16px;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.3px;
}

.streamzy-toast .toast-header strong {
    font-weight: 700;
    font-size: 15px;
}

.streamzy-toast .toast-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.streamzy-toast .toast-icon svg {
    width: 20px;
    height: 20px;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
}

/* Toast Body */
.streamzy-toast .toast-body {
    padding: 14px 16px;
    line-height: 1.5;
    word-wrap: break-word;
}

/* Close Button */
.streamzy-toast .btn-close {
    opacity: 0.8;
    transition: opacity 0.2s ease;
}

.streamzy-toast .btn-close:hover {
    opacity: 1;
}

.streamzy-toast .btn-close:focus {
    box-shadow: 0 0 0 0.15rem rgba(255, 255, 255, 0.3);
}

/* Success Toast */
.streamzy-toast.toast-success {
    background: linear-gradient(135deg, #13bf69 0%, #0fa05a 100%);
}

/* Error Toast */
.streamzy-toast.toast-error {
    background: linear-gradient(135deg, #ed1c24 0%, #d01119 100%);
}

/* Warning Toast */
.streamzy-toast.toast-warning {
    background: linear-gradient(135deg, #ff9900 0%, #e68a00 100%);
}

/* Info Toast */
.streamzy-toast.toast-info {
    background: linear-gradient(135deg, #2b6ccd 0%, #1f5bb5 100%);
}

/* Animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInLeft {
    from {
        transform: translateX(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideInTop {
    from {
        transform: translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

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

/* Position-based animations */
.toast-container[style*="right"] .streamzy-toast {
    animation: slideInRight 0.3s ease-out;
}

.toast-container[style*="left"] .streamzy-toast {
    animation: slideInLeft 0.3s ease-out;
}

/* Hiding animation */
.streamzy-toast.hiding {
    animation: fadeOut 0.2s ease-in forwards;
}

/* Responsive Design */
@media (max-width: 576px) {
    .streamzy-toast {
        min-width: 280px;
        max-width: calc(100vw - 40px);
        margin-bottom: 10px;
    }

    #toast-container {
        left: 20px !important;
        right: 20px !important;
        width: calc(100% - 40px);
    }

    .streamzy-toast .toast-header {
        padding: 10px 12px;
        font-size: 13px;
    }

    .streamzy-toast .toast-body {
        padding: 12px;
        font-size: 13px;
    }
}

/* Dark Theme Integration */
.streamzy-toast .toast-header {
    background-color: rgba(0, 0, 0, 0.15);
}

.streamzy-toast .toast-body {
    background-color: rgba(0, 0, 0, 0.05);
}

/* Progress Bar (Optional) */
.streamzy-toast .toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 0 0 8px 8px;
    overflow: hidden;
}

.streamzy-toast .toast-progress-bar {
    height: 100%;
    background: rgba(255, 255, 255, 0.8);
    animation: progressShrink 5s linear forwards;
}

@keyframes progressShrink {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

/* Hover pause */
.streamzy-toast:hover .toast-progress-bar {
    animation-play-state: paused;
}

/* Multiple toasts stacking */
.toast-container .streamzy-toast:not(:last-child) {
    margin-bottom: 12px;
}

/* Loading toast variation */
.streamzy-toast.toast-loading .toast-icon svg {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Action buttons in toast */
.streamzy-toast .toast-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.streamzy-toast .toast-action-btn {
    padding: 6px 14px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
}

.streamzy-toast .toast-action-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.5);
}

/* Accessibility */
.streamzy-toast:focus-within {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .streamzy-toast {
        border: 2px solid currentColor;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .streamzy-toast {
        animation: none;
        transition: none;
    }
}
