.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
}

/* Base Toast Styles */
.toast {
    position: relative;
    min-width: 320px;
    max-width: 480px;
    padding: 16px 20px;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    pointer-events: auto;
    cursor: pointer;
    overflow: hidden;
    font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
    animation: toastSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transition: all 0.3s ease;
}

.toast:hover {
    transform: translateX(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
}

.toast.removing {
    animation: toastSlideOut 0.3s ease forwards;
}

/* Toast Header */
.toast-header {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.toast-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 600;
    color: #ffffff;
}

.toast-content {
    flex: 1;
    min-width: 0;
}

.toast-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
    margin: 0 0 4px 0;
    color: var(--text-primary);
    font-family: 'Orbitron', 'Inter', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.toast-message {
    font-size: 13px;
    line-height: 1.4;
    color: var(--text-secondary);
    margin: 0;
    word-wrap: break-word;
}

.toast-close {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.7);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 16px;
    line-height: 1;
}

.toast-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

/* Progress Bar */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 0 0 12px 12px;
    animation: toastProgress var(--duration, 5s) linear forwards;
}

/* Toast Types */
.toast.success {
    background: linear-gradient(135deg,
            rgba(0, 255, 127, 0.15) 0%,
            rgba(0, 200, 100, 0.15) 100%);
    border-color: rgba(0, 255, 127, 0.3);
}

.toast.success .toast-icon {
    background: linear-gradient(135deg, #00FF7F 0%, #00C864 100%);
}

.toast.success .toast-progress {
    background: linear-gradient(90deg, #00FF7F 0%, #00C864 100%);
}

.toast.error {
    background: linear-gradient(135deg,
            rgba(255, 69, 58, 0.15) 0%,
            rgba(255, 107, 53, 0.15) 100%);
    border-color: rgba(255, 69, 58, 0.3);
}

.toast.error .toast-icon {
    background: linear-gradient(135deg, #FF453A 0%, #FF6B35 100%);
}

.toast.error .toast-progress {
    background: linear-gradient(90deg, #FF453A 0%, #FF6B35 100%);
}

.toast.warning {
    background: linear-gradient(135deg,
            rgba(255, 215, 0, 0.15) 0%,
            rgba(255, 165, 0, 0.15) 100%);
    border-color: rgba(255, 215, 0, 0.3);
}

.toast.warning .toast-icon {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #000000;
}

.toast.warning .toast-progress {
    background: linear-gradient(90deg, #FFD700 0%, #FFA500 100%);
}

.toast.info {
    background: linear-gradient(135deg,
            rgba(0, 212, 255, 0.15) 0%,
            rgba(124, 58, 237, 0.15) 100%);
    border-color: rgba(0, 212, 255, 0.3);
}

.toast.info .toast-icon {
    background: linear-gradient(135deg, #00D4FF 0%, #7C3AED 100%);
}

.toast.info .toast-progress {
    background: linear-gradient(90deg, #00D4FF 0%, #7C3AED 100%);
}

.toast.loading {
    background: linear-gradient(135deg,
            rgba(47, 47, 84, 0.15) 0%,
            rgba(90, 90, 159, 0.15) 100%);
    border-color: rgba(90, 90, 159, 0.3);
}

.toast.loading .toast-icon {
    background: linear-gradient(135deg, #666666 0%, #999999 100%);
}

.toast.loading .toast-progress {
    background: linear-gradient(90deg, #666666 0%, #999999 100%);
    animation: toastProgressPulse 2s ease-in-out infinite;
}

.toast.urgent {
    background: linear-gradient(135deg,
            rgba(255, 0, 100, 0.2) 0%,
            rgba(255, 69, 58, 0.2) 100%);
    border-color: rgba(255, 0, 100, 0.4);
    animation: toastSlideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        toastUrgentPulse 2s ease-in-out infinite;
}

.toast.urgent .toast-icon {
    background: linear-gradient(135deg, #FF0064 0%, #FF453A 100%);
    animation: toastIconSpin 1s linear infinite;
}

.toast.urgent .toast-progress {
    background: linear-gradient(90deg, #FF0064 0%, #FF453A 100%);
}

/* Loading Spinner */
.toast-spinner {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: toastSpinner 1s linear infinite;
}

/* ✅ TOAST ACTIONS STYLES */
.toast-actions {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.toast-action-btn {
    flex: 1;
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.toast-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.toast-action-btn:active {
    transform: translateY(0);
}

/* Action Button Types */
.toast-action-btn--primary {
    background: linear-gradient(135deg, #00D4FF 0%, #0099CC 100%);
    color: #ffffff;
}

.toast-action-btn--primary:hover {
    background: linear-gradient(135deg, #00B8E6 0%, #0088BB 100%);
}

.toast-action-btn--secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.toast-action-btn--secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.toast-action-btn--danger {
    background: linear-gradient(135deg, #FF453A 0%, #CC2E26 100%);
    color: #ffffff;
}

.toast-action-btn--danger:hover {
    background: linear-gradient(135deg, #E6392F 0%, #B82922 100%);
}

.toast-action-btn--success {
    background: linear-gradient(135deg, #00FF7F 0%, #00CC66 100%);
    color: #000000;
}

.toast-action-btn--success:hover {
    background: linear-gradient(135deg, #00E673 0%, #00B85C 100%);
}

.toast-action-btn--default {
    background: rgba(150, 150, 150, 0.2);
    color: #ffffff;
    border: 1px solid rgba(150, 150, 150, 0.3);
}

.toast-action-btn--default:hover {
    background: rgba(150, 150, 150, 0.3);
}

/* Mobile responsive actions */
@media (max-width: 480px) {
    .toast-actions {
        flex-direction: column;
    }

    .toast-action-btn {
        flex: none;
    }
}


/* Animations */
@keyframes toastSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%) scale(0.8);
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

@keyframes toastSlideOut {
    from {
        opacity: 1;
        transform: translateX(0) scale(1);
    }

    to {
        opacity: 0;
        transform: translateX(100%) scale(0.8);
    }
}

@keyframes toastProgress {
    from {
        width: 100%;
    }

    to {
        width: 0%;
    }
}

@keyframes toastProgressPulse {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.8;
    }
}

@keyframes toastUrgentPulse {

    0%,
    100% {
        box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
    }

    50% {
        box-shadow: 0 8px 32px rgba(255, 0, 100, 0.4),
            0 0 0 0 rgba(255, 0, 100, 0.4);
    }
}

@keyframes toastIconSpin {
    to {
        transform: rotate(360deg);
    }
}

@keyframes toastSpinner {
    to {
        transform: rotate(360deg);
    }
}

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

    .toast {
        min-width: auto;
        max-width: none;
    }
}

/* Dark mode adjustments */
@media (prefers-color-scheme: dark) {
    .toast {
        background: rgba(20, 20, 30, 0.95);
        border-color: rgba(255, 255, 255, 0.15);
    }
}

/* ✅ PHOTO PREVIEW TOAST - ULTRA COMPACT */
.toast.photo-preview {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    min-width: auto !important;
    max-width: 90vw !important;
    max-height: 90vh !important;
    width: auto;
    height: auto;
    padding: 0 !important;
    background: rgba(0, 0, 0, 0.95) !important;
    border: 2px solid #00ffff !important;
    border-radius: 8px !important;
    box-shadow: 0 0 50px rgba(0, 255, 255, 0.3) !important;
}

.toast.photo-preview img {
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    display: block;
    border-radius: 6px;
}

.toast.photo-preview .photo-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 30px;
    height: 30px;
    background: rgba(255, 0, 0, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.toast.photo-preview .photo-close:hover {
    background: rgba(255, 0, 0, 1);
    transform: scale(1.1);
}

/* Math Captcha Input */
.captcha-input {
    font-family: 'Courier New', monospace !important;
    font-size: 16px !important;
    text-align: center !important;
    background: rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    border: 1px solid rgba(255, 255, 255, 0.3) !important;
}

.captcha-input:focus {
    outline: none !important;
    border-color: #00ffff !important;
    box-shadow: 0 0 10px rgba(0, 255, 255, 0.3) !important;
}


/* ✅ NUOVO: TOAST PHOTO STYLES */
.toast-photo {
    flex-shrink: 0;
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.2s ease;
}

.toast-photo:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.toast-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 8px;
}

/* Photo sizes */
.toast-photo--small {
    width: 40px;
    height: 40px;
}

.toast-photo--medium {
    width: 80px;
    height: 80px;
}

.toast-photo--large {
    width: 120px;
    height: 120px;
}

/* Mobile responsive */
@media (max-width: 480px) {
    .toast-photo--large {
        width: 60px;
        height: 60px;
    }
}