/**
 * Estilos para el Sistema de Sincronización Multi-Dispositivo
 * HabitWolf Pro v2.6+
 */

/* ============================================
   INDICADOR DE SINCRONIZACIÓN (Top Bar)
   ============================================ */

.sync-indicator {
    position: fixed;
    top: 16px;
    right: 16px;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    z-index: 1000;
    transition: opacity 0.5s ease, transform 0.5s ease;
    display: flex;
    align-items: center;
    gap: 5px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
}

.sync-indicator.visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.sync-indicator.synced {
    background: rgba(16,185,129,.9);
    color: white;
}

.sync-indicator.syncing {
    background: rgba(59,130,246,.9);
    color: white;
    animation: spin 1s linear infinite;
}

.sync-indicator.error {
    background: rgba(239,68,68,.9);
    color: white;
}

.sync-indicator.offline {
    display: none;
}

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

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

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    25% {
        transform: translateX(-5px);
    }
    75% {
        transform: translateX(5px);
    }
}

/* ============================================
   PANEL DE SINCRONIZACIÓN EN PERFIL
   ============================================ */

.sync-panel {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.sync-panel h3 {
    margin: 0 0 15px 0;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.sync-panel .sync-info {
    background: rgba(255,255,255,0.1);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 15px;
    font-size: 14px;
}

.sync-panel .sync-info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
}

.sync-panel .sync-info-row:last-child {
    margin-bottom: 0;
}

.sync-panel .sync-info-label {
    opacity: 0.9;
}

.sync-panel .sync-info-value {
    font-weight: 600;
}

.sync-panel .sync-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px;
}

.sync-panel .sync-btn {
    padding: 10px 15px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.sync-panel .sync-btn.primary {
    background: white;
    color: #667eea;
}

.sync-panel .sync-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.sync-panel .sync-btn.secondary {
    background: rgba(255,255,255,0.2);
    color: white;
}

.sync-panel .sync-btn.secondary:hover {
    background: rgba(255,255,255,0.3);
}

.sync-panel .sync-btn.danger {
    background: #ef4444;
    color: white;
}

.sync-panel .sync-btn.danger:hover {
    background: #dc2626;
}

/* ============================================
   MODAL DE PRIMER USO
   ============================================ */

.sync-welcome-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.sync-welcome-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    max-width: 500px;
    text-align: center;
    box-shadow: 0 10px 50px rgba(0,0,0,0.3);
}

.sync-welcome-content h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 28px;
}

.sync-welcome-content .feature-list {
    text-align: left;
    margin: 20px 0;
    padding: 0 20px;
}

.sync-welcome-content .feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    font-size: 16px;
}

.sync-welcome-content .feature-icon {
    font-size: 24px;
}

.sync-welcome-content .btn-group {
    display: flex;
    gap: 10px;
    margin-top: 30px;
}

.sync-welcome-content button {
    flex: 1;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.sync-welcome-content button.primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.sync-welcome-content button.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.sync-welcome-content button.secondary {
    background: #e5e7eb;
    color: #4b5563;
}

.sync-welcome-content button.secondary:hover {
    background: #d1d5db;
}

/* ============================================
   ESTADO DE CONEXIÓN (Bottom Bar)
   ============================================ */

.connection-status {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    z-index: 1000;
    background: rgba(0,0,0,0.8);
    color: white;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.connection-status.show {
    opacity: 1;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .sync-indicator {
        top: 10px;
        right: 10px;
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .sync-panel .sync-buttons {
        grid-template-columns: 1fr;
    }
    
    .sync-welcome-content {
        padding: 30px 20px;
        margin: 20px;
    }
    
    .sync-welcome-content h2 {
        font-size: 24px;
    }
}

/* ============================================
   ANIMACIONES ADICIONALES
   ============================================ */

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

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

.sync-indicator.show {
    animation: slideInRight 0.3s ease;
}

.sync-indicator.hide {
    animation: slideOutRight 0.3s ease;
}
