/* Sistema de Feedback Visual - SGT */

/* ===== LOADING STATES ===== */
.tms-loading {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--gray-300);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: tms-spin 1s ease-in-out infinite;
}

.tms-loading-sm {
    width: 16px;
    height: 16px;
    border-width: 2px;
}

.tms-loading-lg {
    width: 32px;
    height: 32px;
    border-width: 3px;
}

@keyframes tms-spin {
    to { transform: rotate(360deg); }
}

/* ===== BUTTON STATES ===== */
.btn-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading .btn-text {
    opacity: 0;
}

.btn-loading .btn-loading-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: block;
}

.btn-success-state {
    background-color: var(--success-color) !important;
    border-color: var(--success-color) !important;
    color: white !important;
}

.btn-error-state {
    background-color: var(--error-color) !important;
    border-color: var(--error-color) !important;
    color: white !important;
}

/* ===== FORM FEEDBACK ===== */
.form-loading {
    position: relative;
    pointer-events: none;
}

.form-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.form-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    border: 3px solid var(--gray-300);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: tms-spin 1s ease-in-out infinite;
    z-index: 11;
}

/* ===== TOAST NOTIFICATIONS ===== */
.tms-toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    max-width: 400px;
}

.tms-toast {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    margin-bottom: 10px;
    padding: 16px;
    border-left: 4px solid var(--primary-color);
    animation: tms-slide-in 0.3s ease-out;
    position: relative;
    overflow: hidden;
}

.tms-toast-success {
    border-left-color: var(--success-color);
}

.tms-toast-warning {
    border-left-color: var(--warning-color);
}

.tms-toast-error {
    border-left-color: var(--error-color);
}

.tms-toast-info {
    border-left-color: var(--info-color);
}

.tms-toast-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
}

.tms-toast-icon {
    font-size: 20px;
    margin-right: 12px;
}

.tms-toast-title {
    font-weight: 600;
    font-size: 14px;
    color: var(--gray-800);
}

.tms-toast-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 18px;
    color: var(--gray-500);
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.tms-toast-close:hover {
    background: var(--gray-100);
    color: var(--gray-700);
}

.tms-toast-message {
    font-size: 13px;
    color: var(--gray-600);
    line-height: 1.4;
}

.tms-toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: var(--primary-color);
    animation: tms-progress 5s linear forwards;
}

@keyframes tms-slide-in {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes tms-progress {
    from { width: 100%; }
    to { width: 0%; }
}

/* ===== PROGRESS BARS ===== */
.tms-progress {
    width: 100%;
    height: 8px;
    background: var(--gray-200);
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.tms-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light));
    border-radius: 4px;
    transition: width 0.3s ease;
    position: relative;
}

.tms-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: tms-shimmer 2s infinite;
}

@keyframes tms-shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ===== MODAL LOADING ===== */
.tms-modal-loading {
    position: relative;
}

.tms-modal-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tms-modal-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid var(--gray-300);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: tms-spin 1s ease-in-out infinite;
    z-index: 11;
}

/* ===== TABLE LOADING ===== */
.tms-table-loading {
    position: relative;
}

.tms-table-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tms-table-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 32px;
    height: 32px;
    border: 3px solid var(--gray-300);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: tms-spin 1s ease-in-out infinite;
    z-index: 11;
}

/* ===== SKELETON LOADING ===== */
.tms-skeleton {
    background: linear-gradient(90deg, var(--gray-200) 25%, var(--gray-100) 50%, var(--gray-200) 75%);
    background-size: 200% 100%;
    animation: tms-skeleton-loading 1.5s infinite;
    border-radius: 4px;
}

.tms-skeleton-text {
    height: 16px;
    margin-bottom: 8px;
}

.tms-skeleton-text:last-child {
    margin-bottom: 0;
    width: 60%;
}

.tms-skeleton-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
}

.tms-skeleton-button {
    height: 36px;
    width: 100px;
}

@keyframes tms-skeleton-loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ===== PULSE ANIMATIONS ===== */
.tms-pulse {
    animation: tms-pulse 2s infinite;
}

@keyframes tms-pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* ===== FADE ANIMATIONS ===== */
.tms-fade-in {
    animation: tms-fade-in 0.3s ease-out;
}

.tms-fade-out {
    animation: tms-fade-out 0.3s ease-out;
}

@keyframes tms-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes tms-fade-out {
    from { opacity: 1; transform: translateY(0); }
    to { opacity: 0; transform: translateY(-10px); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .tms-toast-container {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .tms-toast {
        padding: 12px;
    }
    
    .tms-toast-title {
        font-size: 13px;
    }
    
    .tms-toast-message {
        font-size: 12px;
    }
}

/* ===== UTILITY CLASSES ===== */
.tms-hidden { display: none !important; }
.tms-visible { display: block !important; }
.tms-invisible { visibility: hidden !important; }
.tms-opacity-0 { opacity: 0 !important; }
.tms-opacity-50 { opacity: 0.5 !important; }
.tms-opacity-100 { opacity: 1 !important; }

.tms-pointer-events-none { pointer-events: none !important; }
.tms-pointer-events-auto { pointer-events: auto !important; }

.tms-transition { transition: all 0.3s ease !important; }
.tms-transition-fast { transition: all 0.15s ease !important; }
.tms-transition-slow { transition: all 0.5s ease !important; }

