/* Estilos para la integración con la API */

/* Indicador de carga */
.loading-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px;
    color: var(--text-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 16px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Mensajes de estado */
.status-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 12px 20px;
    border-radius: var(--border-radius);
    color: white;
    font-weight: 500;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
    max-width: 400px;
    word-wrap: break-word;
}

.status-message.success {
    background-color: #10b981;
    border-left: 4px solid #059669;
}

.status-message.error {
    background-color: #ef4444;
    border-left: 4px solid #dc2626;
}

.status-message.info {
    background-color: #3b82f6;
    border-left: 4px solid #2563eb;
}

.status-message.warning {
    background-color: #f59e0b;
    border-left: 4px solid #d97706;
}

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

/* Mensajes de error */
.error-message {
    text-align: center;
    padding: 40px;
    color: #ef4444;
    background-color: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: var(--border-radius);
    margin: 20px;
}

.error-message::before {
    content: "⚠️ ";
    font-size: 1.2em;
    margin-right: 8px;
}

/* Sin resultados */
.no-results {
    text-align: center;
    padding: 40px;
    color: var(--text-muted);
    font-style: italic;
    background-color: var(--accent-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius);
    margin: 20px;
}

.no-results::before {
    content: "📭 ";
    font-size: 1.2em;
    margin-right: 8px;
}

/* Botones deshabilitados durante carga */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    pointer-events: none;
}

/* Animación de pulsación para botones en proceso */
.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Mejoras para modales */
.modal-content {
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Indicador de conexión */
.connection-status {
    position: fixed;
    bottom: 20px;
    left: 20px;
    padding: 8px 12px;
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    z-index: 1000;
}

.connection-status.online {
    background-color: #10b981;
    color: white;
}

.connection-status.offline {
    background-color: #ef4444;
    color: white;
}

.connection-status::before {
    content: "● ";
    margin-right: 4px;
}

/* Responsive para móviles */
@media (max-width: 768px) {
    .status-message {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .connection-status {
        bottom: 10px;
        left: 10px;
        font-size: 0.75rem;
    }
}
