﻿
/* Toast Container */
.tostadora {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-width: 400px;
    width: 400px;
    pointer-events: none;
}


.tostadita {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: white;
    border-radius: 5px;
    padding: 16px 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 300px;
    pointer-events: auto;
    position: relative;
    overflow: hidden;
    animation: slideIn 0.3s ease-out;
    transition: all 0.3s ease-out;
    max-height: 200px;
    margin-bottom: 0;
}

    .tostadita.closing {
        animation: slideOut 0.3s ease-in forwards;
        max-height: 0;
        margin-bottom: -12px;
        padding-top: 0;
        padding-bottom: 0;
        opacity: 0;
    }
    /*Toast Types*/

    .tostadita.error-bg {
        border-left: 4px solid white;
    }
/*.tostadita.success { border-left: 4px solid #28a745; }
    .tostadita.error { border-left: 4px solid #a94442; }
    .tostadita.warning { border-left: 4px solid #ffc107; }
    .tostadita.info { border-left: 4px solid #17a2b8; }
    .tostadita.promise { border-left: 4px solid #007bff; } 
*/

/* Toast Icon */
.tostadita-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-weight: bold;
    font-size: 16px;
}

.tostadita.success .tostadita-icon {
    background: #d1fae5;
    color: #28a745;
}

.tostadita.error .tostadita-icon {
    background: #fee2e2;
    color: #a94442;
}

.tostadita.error-bg .tostadita-icon {
    color: #a94442;
    background: white;
}

.tostadita.error-bg .tostadita-title,
.tostadita.error-bg .tostadita-message {
    color: white;
}

.tostadita.error-bg {
    color: white;
    background: #a94442;
}


.tostadita.warning .tostadita-icon {
    background: #fef3c7;
    color: #ffc107;
}

.tostadita.info .tostadita-icon {
    background: #dbeafe;
    color: #17a2b8;
}

.tostadita.promise .tostadita-icon {
    background: #ede9fe;
    color: #007bff;
}

/* Spinner for promise tostadita */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e5e7eb;
    border-top-color: #007bff;
    border-left-color: #007bff;
    border-right-color: #007bff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Toast Content */
.tostadita-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tostadita-title {
    font-weight: 600;
    font-size: 14px;
    color: #1f2937;
}

.tostadita-message {
    font-size: 13px;
    color: #6b7280;
}

/* Close Button */
.tostadita-close {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: none;
    background: transparent;
    cursor: pointer;
    color: #9ca3af;
    font-size: 18px;
    line-height: 1;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background 0.2s, color 0.2s;
}

    .tostadita-close:hover {
        background: #f3f4f6;
        color: #1f2937;
    }

.tostadita.error-bg .tostadita-close {
    color: white;
}
/* Progress Bar for auto-close */
.tostadita-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(0,0,0,0.1);
    transform-origin: left;
}

.tostadita.success .tostadita-progress {
    background: #28a745;
}

.tostadita.error .tostadita-progress {
    background: #a94442;
}

.tostadita.error-bg .tostadita-progress {
    background: white;
}

.tostadita.warning .tostadita-progress {
    background: #ffc107;
}

.tostadita.info .tostadita-progress {
    background: #17a2b8;
}

.tostadita.promise .tostadita-progress {
    background: #007bff;
}

.tostadita-progress.animate {
    animation: progress 5s linear forwards;
}

@keyframes progress {
    from {
        width: 100%;
    }

    to {
        width: 0%;
    }
}

/* Animations */
@keyframes slideIn {
    from {
        max-height: 0;
        padding-top: 0;
        padding-bottom: 0;
        opacity: 0;
    }

    to {
        max-height: 200px;
        padding-top: 16px;
        padding-bottom: 16px;
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
        max-height: 200px;
    }

    to {
        transform: translateX(400px);
        opacity: 0;
        max-height: 0;
    }
}


/* Responsive */
@media (max-width: 480px) {
    .tostadora {
        margin: 0px 5px;
        max-width: none;
        right: auto;
        bottom: initial;
        top: 10px;
    }

    .tostadita {
        min-width: auto;
        width: auto;
        max-width: fit-content;
        min-width: -webkit-fill-available;
        min-width: -moz-available;
        min-width: fill-available;
    }
}
