/* Toast Notification System */

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

.toast {
    min-width: 300px;
    max-width: 500px;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    pointer-events: all;
    animation: slideIn 0.3s ease-out;
    transition: all 0.3s ease;
    font-size: 14px;
    line-height: 1.4;
}

.toast.hiding {
    animation: slideOut 0.3s ease-in forwards;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(400px);
        opacity: 0;
    }
}

.toast-icon {
    font-size: 20px;
    flex-shrink: 0;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 600;
    margin-bottom: 4px;
}

.toast-message {
    color: rgba(0, 0, 0, 0.7);
}

.toast-close {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

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

/* Toast Types */
.toast.success {
    background-color: #10b981;
    color: white;
}

.toast.success .toast-message {
    color: rgba(255, 255, 255, 0.9);
}

.toast.error {
    background-color: #ef4444;
    color: white;
}

.toast.error .toast-message {
    color: rgba(255, 255, 255, 0.9);
}

.toast.warning {
    background-color: #f59e0b;
    color: white;
}

.toast.warning .toast-message {
    color: rgba(255, 255, 255, 0.9);
}

.toast.info {
    background-color: #3b82f6;
    color: white;
}

.toast.info .toast-message {
    color: rgba(255, 255, 255, 0.9);
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner.dark {
    border-color: rgba(0, 0, 0, 0.1);
    border-top-color: #333;
}

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

/* Loading Button States */
button.loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

button.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

button.loading.btn-light::after,
button.loading.btn-outline::after {
    border-color: rgba(0, 0, 0, 0.1);
    border-top-color: #333;
}

/* Enhanced Interactive States */
button,
a.btn,
.interactive {
    transition: all 0.2s ease;
}

button:not(:disabled):hover,
a.btn:hover,
.interactive:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

button:not(:disabled):active,
a.btn:active,
.interactive:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.2s ease;
}

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

.loading-overlay .spinner-large {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.loading-overlay .loading-text {
    color: white;
    margin-top: 20px;
    font-size: 16px;
    font-weight: 500;
}

/* Progress Bar */
.progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background-color: #3b82f6;
    transform-origin: left;
    animation: progress 2s ease-in-out;
    z-index: 10001;
}

@keyframes progress {
    0% {
        transform: scaleX(0);
    }
    50% {
        transform: scaleX(0.5);
    }
    100% {
        transform: scaleX(1);
    }
}

/* Responsive Design */
@media (max-width: 640px) {
    .toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
    }
    
    .toast {
        min-width: auto;
        max-width: 100%;
    }
}
