/*
⚠️ IMPORTANTE: Sigue las directrices del framework Vibe.
Ver: /.github/copilot-instructions.md

Refresh System - Estilos para botón y modal de progreso
Vibe Framework Implementation
*/

/* ============================================
   BOTÓN REFRESH EN SIDEBAR
   ============================================ */
.btn-refresh {
    width: 100%;
    padding: 12px 16px;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 6px rgba(102, 126, 234, 0.3);
}

.btn-refresh:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(102, 126, 234, 0.4);
}

.btn-refresh:active:not(:disabled) {
    transform: translateY(0);
}

.btn-refresh:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-refresh .refresh-icon {
    font-size: 16px;
    transition: transform 0.6s ease;
}

.btn-refresh.spinning .refresh-icon {
    animation: spin 1s linear infinite;
}

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

/* ============================================
   MODAL DE PROGRESO
   ============================================ */
.refresh-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

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

.refresh-modal {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 16px;
    padding: 32px;
    max-width: 500px;
    width: 90%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.refresh-modal-header {
    text-align: center;
    margin-bottom: 24px;
}

.refresh-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    margin: 0 0 8px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.refresh-modal-title .icon {
    font-size: 24px;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.refresh-modal-subtitle {
    font-size: 14px;
    color: #94a3b8;
    margin: 0;
}

/* ============================================
   PASOS DEL PROGRESO
   ============================================ */
.refresh-steps {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 24px;
}

.refresh-step {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 8px;
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
}

.refresh-step.pending {
    border-left-color: #64748b;
}

.refresh-step.active {
    border-left-color: #3b82f6;
    background: rgba(59, 130, 246, 0.1);
}

.refresh-step.completed {
    border-left-color: #10b981;
    background: rgba(16, 185, 129, 0.1);
}

.refresh-step.error {
    border-left-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.step-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.refresh-step.pending .step-icon {
    opacity: 0.3;
}

.refresh-step.active .step-icon {
    animation: bounce 1s ease-in-out infinite;
}

@keyframes bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
}

.step-content {
    flex: 1;
}

.step-title {
    font-size: 15px;
    font-weight: 600;
    color: #fff;
    margin: 0 0 4px 0;
}

.step-description {
    font-size: 13px;
    color: #94a3b8;
    margin: 0;
}

.step-status {
    font-size: 20px;
    flex-shrink: 0;
}

.refresh-step.pending .step-status::before {
    content: '⏸️';
}

.refresh-step.active .step-status::before {
    content: '⏳';
}

.refresh-step.completed .step-status::before {
    content: '✅';
}

.refresh-step.error .step-status::before {
    content: '❌';
}

/* ============================================
   BARRA DE PROGRESO
   ============================================ */
.refresh-progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 24px;
}

.refresh-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border-radius: 4px;
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(102, 126, 234, 0.5);
}

/* ============================================
   BOTONES DEL MODAL
   ============================================ */
.refresh-modal-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.refresh-modal-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}

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

.refresh-modal-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

.refresh-modal-btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #e2e8f0;
}

.refresh-modal-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* ============================================
   ESTADOS DE ERROR Y ÉXITO
   ============================================ */
.refresh-result {
    text-align: center;
    padding: 24px;
}

.refresh-result-icon {
    font-size: 64px;
    margin-bottom: 16px;
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

.refresh-result-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px 0;
}

.refresh-result.success .refresh-result-title {
    color: #10b981;
}

.refresh-result.error .refresh-result-title {
    color: #ef4444;
}

.refresh-result-message {
    font-size: 14px;
    color: #94a3b8;
    margin: 0 0 24px 0;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .refresh-modal {
        padding: 24px;
        width: 95%;
    }
    
    .refresh-modal-title {
        font-size: 18px;
    }
    
    .refresh-step {
        padding: 12px;
    }
    
    .step-title {
        font-size: 14px;
    }
    
    .step-description {
        font-size: 12px;
    }
}
