/**
 * Uniplus Core CSS
 * Sistema de toast notifications e estados de loading
 */

/* Toast Notifications */
.uniplus-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-width: 400px;
}

.uniplus-toast {
    padding: 14px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    animation: slideIn 0.3s ease-out;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-size: 14px;
}

.uniplus-toast.success {
    background: #10b981;
    color: white;
}

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

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

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

.uniplus-toast-icon {
    font-size: 18px;
}

.uniplus-toast-close {
    margin-left: auto;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.uniplus-toast-close:hover {
    opacity: 1;
}

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

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

/* Loading States */
.uniplus-loading {
    position: relative;
    pointer-events: none;
}

.uniplus-loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.uniplus-loading-spinner {
    width: 24px;
    height: 24px;
    border: 3px solid #e5e7eb;
    border-top-color: #3b82f6;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.uniplus-btn-loading {
    position: relative;
    color: transparent !important;
}

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

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

/* Table improvements */
.uniplus-table-container {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.uniplus-table-container::-webkit-scrollbar {
    height: 8px;
}

.uniplus-table-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.uniplus-table-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.uniplus-table-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Standardized buttons */
.uniplus-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

.uniplus-btn-primary {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
}

.uniplus-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.uniplus-btn-secondary {
    background: #f1f5f9;
    color: #475569;
}

.uniplus-btn-secondary:hover {
    background: #e2e8f0;
}

.uniplus-btn-danger {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.uniplus-btn-danger:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

.uniplus-btn-success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.uniplus-btn-success:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.4);
}

.uniplus-btn-outline {
    background: transparent;
    border: 1px solid #e2e8f0;
    color: #475569;
}

.uniplus-btn-outline:hover {
    background: #f8fafc;
    border-color: #cbd5e1;
}

.uniplus-btn-sm {
    padding: 6px 12px;
    font-size: 13px;
}

.uniplus-btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

.uniplus-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Error states */
.uniplus-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #dc2626;
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.uniplus-error-inline {
    color: #dc2626;
    font-size: 12px;
    margin-top: 4px;
}

/* Empty state */
.uniplus-empty {
    text-align: center;
    padding: 48px 24px;
    color: #64748b;
}

.uniplus-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

.uniplus-empty-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #334155;
}

.uniplus-empty-description {
    font-size: 14px;
}
